Skip to content

Hetzner - Backupspace - Borgbackup

Linux
4 1 1.1k
  • 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.

  • OpenCloud - Docker Compose local

    Verschoben OpenCloud opencloud linux
    3
    1
    0 Stimmen
    3 Beiträge
    756 Aufrufe
    FrankMF
    Noch was Wichtiges. Die Docker Installation nutzt folgende config. In meinem Beispiel findet man sie unter /home/frank/opencloud/deployments/examples/opencloud_full Darin liegt ein .env ## Basic Settings ## # Define the docker compose log driver used. # Defaults to local LOG_DRIVER= # If you're on an internet facing server, comment out following line. # It skips certificate validation for various parts of OpenCloud and is # needed when self signed certificates are used. INSECURE=true ## Traefik Settings ## # Note: Traefik is always enabled and can't be disabled. # Serve Traefik dashboard. # Defaults to "false". TRAEFIK_DASHBOARD= # Domain of Traefik, where you can find the dashboard. # Defaults to "traefik.opencloud.test" TRAEFIK_DOMAIN= # Basic authentication for the traefik dashboard. # Defaults to user "admin" and password "admin" (written as: "admin:$2y$05$KDHu3xq92SPaO3G8Ybkc7edd51pPLJcG1nWk3lmlrIdANQ/B6r5pq"). # To create user:password pair, it's possible to use this command: # echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g TRAEFIK_BASIC_AUTH_USERS= # Email address for obtaining LetsEncrypt certificates. # Needs only be changed if this is a public facing server. TRAEFIK_ACME_MAIL= # Set to the following for testing to check the certificate process: # "https://acme-staging-v02.api.letsencrypt.org/directory" # With staging configured, there will be an SSL error in the browser. # When certificates are displayed and are emitted by # "Fake LE Intermediate X1", # the process went well and the envvar can be reset to empty to get valid certificates. TRAEFIK_ACME_CASERVER= [....gekürzt....] Man kann dort etwas ändern und mittels docker compose up -d alles aktualisieren. Radicale OpenCloud nutzt im Moment folgendes https://radicale.org/v3.html als Backend Server für Kalender & Kontakte. Jemand hat mir dann erklärt, wie das so funktioniert. Danach hatte es dann klick gemacht. https://fosstodon.org/@h4kamp/114562514701351170 In der config findet man zum Beispiel die Konfiguration für radicale (Kalender- und Kontakte-App) Das ist nur eine rudimentäre Ablage, wird gesteuert über Clienten, z.B. die Thunderbird Kalender Funktion. ### Radicale Setting ### # Radicale is a small open-source CalDAV (calendars, to-do lists) and CardDAV (contacts) server. # When enabled OpenCloud is configured as a reverse proxy for Radicale, providing all authenticated # OpenCloud users access to a Personal Calendar and Addressbook RADICALE=:radicale.yml # Docker image to use for the Radicale Container #RADICALE_DOCKER_IMAGE=opencloudeu/radicale # Docker tag to pull for the Radicale Container #RADICALE_DOCKER_TAG=latest # Define the storage location for the Radicale data. Set the path to a local path. # Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000. # This matches the default user inside the container and avoids permission issues when accessing files. # Leaving it default stores data in docker internal volumes. #RADICALE_DATA_DIR=/your/local/radicale/data In einer Standard Installation ist das auskommentiert. RADICALE=:radicale.yml Danach ein docker compose up -d und Eure Kalendereinträge (extern auf einem Clienten verwaltet) werden in der OpenCloud gesichert.
  • Links zu Vaultwarden

    Angeheftet Vaultwarden vaultwarden bitwarden linux
    1
    0 Stimmen
    1 Beiträge
    177 Aufrufe
    Niemand hat geantwortet
  • NAS 2023 - Software Teil 2

    Angeheftet Verschoben Linux nas linux
    1
    4
    0 Stimmen
    1 Beiträge
    264 Aufrufe
    Niemand hat geantwortet
  • Fedora 34

    Linux fedora linux
    5
    2
    0 Stimmen
    5 Beiträge
    514 Aufrufe
    FrankMF
    https://www.youtube.com/watch?v=Pzl1B7nB9Kc&t=328s
  • FreeOTP+

    Linux linux freeotp+
    3
    1
    0 Stimmen
    3 Beiträge
    683 Aufrufe
    FrankMF
    Falls mal jemand von FreeOTP+ zum Bitwarden Authenticator wechseln möchte, ich habe da mal was gebaut https://forgejo.linux-nerds.org/frank/freeotpplus-export-to-bitwarden-authenticator
  • Thunderbird - Schriftgröße der Mailansicht dauerhaft ändern

    Linux linux thunderbird
    1
    0 Stimmen
    1 Beiträge
    232 Aufrufe
    Niemand hat geantwortet
  • Kernel-Log 4.20

    Linux linux
    1
    0 Stimmen
    1 Beiträge
    357 Aufrufe
    Niemand hat geantwortet
  • SSH Login ohne Passwort

    Angeheftet Linux linux
    4
    0 Stimmen
    4 Beiträge
    2k Aufrufe
    FrankMF
    Wie ihr ja wisst, benutze ich das Forum hier auch gerne als Notizbuch Also mal wieder was hier notieren. Mein Windows Systemadmin sagte mir heute, das es auch folgendes gibt # ssh-keygen -t ed25519 Generating public/private ed25519 key pair. Enter file in which to save the key (/root/.ssh/id_ed25519): /tmp/ed Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /tmp/ed Your public key has been saved in /tmp/ed.pub The key fingerprint is: SHA256:D33HCTW7Dy0p5kQdFTkPudx1PQh0EHFgkBvxy8KwhGM root@frank-ms7c92 The key's randomart image is: +--[ED25519 256]--+ | o=O*o=+=| | . oo o+oB+| | E o o.o.o+*| | . o +o...oo=o| | .So.o= O .| | o.= o + | | . . .| | | | | +----[SHA256]-----+ Der Key liegt nur in /tmp kopieren lohnt also nicht Ob das jetzt die Zukunft ist, kann ich nicht beantworten. Ich wollte es aber hier mal festhalten, weil es wohl mittlerweile auch von vielen Projekten benutzt wird. https://en.wikipedia.org/wiki/Ssh-keygen