Skip to content

Hetzner - Backupspace - Borgbackup

Linux
  • Mein Server ist von Hetzner, dort kann man Backupspace dazu buchen, teilweise ist er auch mit drin. Dann wollen wir das mal Testen.

    Die Anleitung

    Ich hatte erst eine andere Anleitung von Hetzner, wo das mit dem Port 23 nicht drin stand. Hat dann was länger gedauert, bis es ohne Passwort ging 😉 Aber, am Ende ging es dann mit

     sftp -P 23 u123456@u123456.your-backup.de
    

    Nun kann man mittels Borgbackup Daten verschlüsselt dort ablegen.

    INIT

     borg init --encryption=repokey ssh://u123456@u123456.your-backup.de:23/./backup
     Enter new passphrase: 
     Enter same passphrase again: 
     Do you want your passphrase to be displayed for verification? [yN]: N
     
     By default repositories initialized with this version will produce security
     errors if written to with an older version (up to and including Borg 1.0.8).
     
     If you want to use these older versions, you can disable the check by running:
     borg upgrade --disable-tam ssh://u123456@u123456.your-backup.de:23/./backup
     
     See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
     
     IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
     Use "borg key export" to export the key, optionally in printable format.
     Write down the passphrase. Store both at safe place(s).
    

    CREATE

    borg create ssh://u123456@u123456.your-backup.de:23/./backup::initial /backup
       Enter passphrase for key ssh://u123456@u123456.your-backup.de:23/./backup: 
    

    Wenn man sehen will, was passiert kann man das so machen.

    borg create --list ssh://u123456@u123456.your-backup.de:23/./backup::initial /backup
    

    Dann zeigt Borg an was er die ganze Zeit macht.

    LIST

    borg list ssh://u123456@u123456.your-backup.de:23/./backup::initial
    

    Kleine Ergänzung. Das Backup heißt vm1

     borg list ssh://u123456@u123456.your-backup.de:23/./backup/vm1
    

    Das würde jetzt alle Backups auflisten.

    Der Inhalt würde ein Backup mit dem Namen vm1-2019-09-23T09:00:02 enthalten.

    borg list ssh://u123456@u123456.your-backup.de:23/./backup/vm1::vm1-2019-09-23T09:00:02
    

    Dann zeigt Borg den Inhalt des Backups an.

    DELETE

    borg delete ssh://u123456@u123456.your-backup.de:23/./backup::initial
    

    Anleitung

    Der Link zur Anleitung von Borgbackup

    Jetzt das Ganze noch automatisieren, das alle paar Tage die Daten automatisch gesichert werden.

  • Zum Automatisieren, das Script hier nehmen.

    Das ganz anpassen und einen crontab anlegen. Fertig! Sieht dann so aus.

    root@ ~ # ./borg.sh
    
    Sat 07 Sep 2019 04:24:40 PM CEST Starting backup
    
    Creating archive at "ssh://u123456@u123456.your-backup.de:23/./backups/01::01-2019-09-07T16:24:40"
    A /backup/dump/vzdump-qemu-103-2019_09_06-00_00_30.log
    ------------------------------------------------------------------------------
    Archive name: 01-2019-09-07T16:24:40
    Archive fingerprint: f66f5a895cd7xxxxxxxxxxxxxxxxxxx6ad974aec87bd
    Time (start): Sat, 2019-09-07 16:25:22
    Time (end):   Sat, 2019-09-07 16:25:22
    Duration: 0.14 seconds
    Number of files: 72
    Utilization of max. archive size: 0%
    ------------------------------------------------------------------------------
                           Original size      Compressed size    Deduplicated size
    This archive:              109.88 GB            108.55 GB                979 B
    All archives:              616.83 GB            610.37 GB            107.94 GB
    
                           Unique chunks         Total chunks
    Chunk index:                   41509               236521
    ------------------------------------------------------------------------------
    terminating with success status, rc 0
    
    Sat 07 Sep 2019 04:25:34 PM CEST Pruning repository
    
    Keeping archive: 01-2019-09-07T16:24:40           Sat, 2019-09-07 16:25:22 [f66f5a895cd7dc8f0cecxxxxxxxxxxxxxxxxxxxxxx76ad974aec87bd]
    Pruning archive: 01-2019-09-07T16:18:34           Sat, 2019-09-07 16:18:49 [c6803a17a72d5246bxxxxxxxxxxxxxxxxxxxxxxxxxx61d80b5c9210b6a00c11b] (1/1)
    terminating with success status, rc 0
    
  • Heute noch nachgesehen, ob der cron seine Arbeit gemacht hat. War alles erfolgreich 😉 Damit ist das kleine Projekt dann erfolgreich beendet. Die VMs werden jetzt einmal die Woche auf den externen Backup-Space, verschlüsselt abgelegt.

  • Ok, da gibt es doch wohl noch ein kleines Problem 🙂

    Hetzner hat die Dienste migriert und ich war der Meinung, der Borg funktioniert nicht mehr. Ok, das hat er auch gemacht, aber der Grund wurde mir dann vom Support mitgeteilt, Der Backup Space ist voll. Huch, was läuft denn da falsch!?

    Ich konnte den Backup Space noch per SFTP erreichen, Borg gab aber immer eine merkwürdige Fehlermeldung heraus.
    Also aufpassen, wenn ihr mal Probleme habt, schaut mal nach ob ihr noch genug Platz habt 😉

    Und jetzt muss ich das Script mal ein wenig überarbeiten, irgendwas läuft da nicht so, wie ich mir das vorstelle.

  • Manjaro Btrfs Snapshot auswählen

    Linux manjaro linux
    1
    2
    0 Stimmen
    1 Beiträge
    379 Aufrufe
    Niemand hat geantwortet
  • RockPro64 - Mainline Kernel 6.8.0-rc3

    ROCKPro64 rockpro64 linux mainline
    2
    0 Stimmen
    2 Beiträge
    410 Aufrufe
    FrankMF
    https://github.com/ayufan-rock64/linux-mainline-kernel/releases/tag/6.8.0-1190-ayufan
  • Proxmox - Backup Server WakeOnLan

    Proxmox proxmox linux wakeonlan
    1
    2
    0 Stimmen
    1 Beiträge
    769 Aufrufe
    Niemand hat geantwortet
  • Debian 10.4 released und Wireguard kaputt :(

    Linux linux wireguard
    1
    0 Stimmen
    1 Beiträge
    278 Aufrufe
    Niemand hat geantwortet
  • ROCKPro64 - PCIe SATA-Karte mit JMicron JMS585- Chip

    Angeheftet Hardware jms585 linux rockpro64
    13
    1
    1 Stimmen
    13 Beiträge
    2k Aufrufe
    FrankMF
    Ich möchte das dann hier zum Abschluss bringen, das NAS ist heute zusammengebaut worden. Hier zwei Fotos. [image: 1587814588721-img_20200425_102156_ergebnis.jpg] [image: 1587814595011-img_20200425_102206_ergebnis.jpg]
  • Nextcloud Talk

    Nextcloud nextcloud coturn linux talk
    5
    2
    0 Stimmen
    5 Beiträge
    917 Aufrufe
    FrankMF
    All I needed to do was setting the permissions to 744 for the archive directory and the symlinks resolved correctly after a reboot of coturn My turnserver installation on Debian runs as the user turnserver and not as root, nor is the user turnserver in any group owning the letsencrypt directory. If your turnserver does run as root, it should be fine just adding execute permissions. I hope this helps some of you. Quelle: https://help.nextcloud.com/t/lets-encrypt-symlink-breaks-coturn-configuration/70166 Was zum Testen die Tage....
  • Restic & Rclone & Nextcloud

    Linux nextcloud rclone linux restic
    3
    0 Stimmen
    3 Beiträge
    822 Aufrufe
    FrankMF
    Hier mal eine Ausgabe vom ersten Durchgang root@frank-MS-7C37:~# restic --password-file /root/passwd -r rclone:Nextcloud:HOME_UBUNTU backup --files-from /root/includes.txt repository 99xxxxa0 opened successfully, password is correct created new cache in /root/.cache/restic rclone: 2020/05/08 17:47:57 ERROR : locks: error listing: directory not found rclone: 2020/05/08 17:47:58 ERROR : index: error listing: directory not found rclone: 2020/05/08 17:47:58 ERROR : snapshots: error listing: directory not found Files: 3503 new, 0 changed, 0 unmodified Dirs: 2 new, 0 changed, 0 unmodified Added to the repo: 16.872 GiB processed 3503 files, 21.134 GiB in 1:02:56 snapshot fdxxxxec saved Der erste Durchgang hat also etwa eine Stunde benötigt. Durch die Deduplikation der Daten, ist der Vorgang beim zweiten Durchgang viel schneller weil nur neue oder geänderte Daten gesichert werden. Und außerdem sind alle Daten AES-256 verschlüsselt. Also perfekt zur Ablage in irgendeiner Cloud root@frank-MS-7C37:~# restic --password-file /root/passwd -r rclone:Nextcloud:HOME_UBUNTU backup --files-from /root/includes.txt repository 99xxxxa0 opened successfully, password is correct Files: 57 new, 41 changed, 3449 unmodified Dirs: 0 new, 2 changed, 0 unmodified Added to the repo: 22.941 MiB processed 3547 files, 21.137 GiB in 0:13 snapshot c6xxxxe4 saved Wie ihr seht, hat der zweite Durchgang nur ein paar neue und geänderte Daten gesichert. Der Rest ist ja schon vorhanden. Und das kann man dann auch problemlos täglich, wöchentlich oder was auch immer mal eben schnell durchführen. Eines meiner absoluten Lieblingstool
  • Installation von Grav & NGinx & PHP7.2

    Angeheftet Verschoben Grav grav linux
    2
    1
    0 Stimmen
    2 Beiträge
    1k Aufrufe
    FrankMF
    Nachdem ich den ROCKPro64 jetzt auf den Mainline umgestellt habe, lief meine Testinstallation von Grav nicht mehr. Hilfreiche Sache um das Problem zu lösen -> https://gist.github.com/GhazanfarMir/03bd1f1f770a3834d47274586d46ea62 Ich bekam immer 502 Bad Gateway, Grund war ein nicht korrekt gestarteter php-pfm Service. rock64@rockpro64v2_0:/usr/local/bin$ sudo service php7.2-fpm start rock64@rockpro64v2_0:/usr/local/bin$ sudo service php7.2-fpm status ● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-08-16 20:15:20 CEST; 21s ago Docs: man:php-fpm7.2(8) Main PID: 3206 (php-fpm7.2) Status: "Processes active: 0, idle: 2, Requests: 3, slow: 0, Traffic: 0.2req/sec" Tasks: 3 (limit: 4622) CGroup: /system.slice/php7.2-fpm.service ├─3206 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf) ├─3207 php-fpm: pool www └─3208 php-fpm: pool www Aug 16 20:15:19 rockpro64v2_0 systemd[1]: Starting The PHP 7.2 FastCGI Process Manager... Aug 16 20:15:20 rockpro64v2_0 systemd[1]: Started The PHP 7.2 FastCGI Process Manager.