|
|
(206 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) |
Zeile 1: |
Zeile 1: |
| Ein einfaches Python-Script zur Erstellung von inkrementellen, symmetrisch verschlüsselten Backups auf Dateiebene.
| | '''duply''' - [[Inkrementell]]e [[verschlüsselt]]e [[Backup]]s |
|
| |
|
| =duply= | | == Beschreibung == |
| * Ist ein Frontend von [https://de.wikipedia.org/wiki/Duplicity_(Software) duplicity].
| | ; Frontend für [[duplicity]] |
| * Erstellte Backups können sowohl lokal am gesicherten Rechner, als auch entfernt (remote) auf einem anderen System gespeichert werden. | | Shell-Frontend für [[duplicity]] |
| * Unterstützt <tt>ftp, ssh, s3, rsync, cifs, webdav, http</tt>. | | * Verwendung vereinfachen |
| | * Einstellungen in Profilen verwalten |
| | * Stapelverarbeitung |
| | ** Es unterstützt die Ausführung von mehreren Befehlen als Stapelverarbeitung |
| | ** Damit sind einzeilige cron-Einträge möglich und der Benutzer kann Skripte verwenden, die vor oder nach dem Backup ausgeführt werden |
| | * Alle duplicity-Backends werden unterstützt |
|
| |
|
| =Installation=
| | ; Vereinfacht die Ausführung von Duplicity |
|
| | Frontend für [[duplicity]] |
| # apt install duply
| | * Backups können lokal oder einem anderen System gespeichert werden |
| | * Cron oder Kommandozeile |
| | * Speichert Einstellungen in Profilen |
| | * Batch-Operationen |
| | *: ermöglicht, beispielsweise backup_verify+purge |
| | * Ausführung von Pre-/Post-Skripten |
| | * verschiedene Aktionen möglich, abhängig vom vorherigen oder nächsten Befehl oder dessen Rückgabewert |
| | * Vorbedingungsprüfung für fehlerfreie Duplizitätsoperationen |
|
| |
|
| = Konfiguration =
| | Für jeden Sicherungsauftrag wird ein Konfigurationsprofil erstellt |
|
| |
|
| ==Neues duply-Profil erstellen== | | ; Profilordner |
| | <syntaxhighlight lang="bash" highlight="1" line copy> |
| | ~/.duply/<profile> |
| | </syntaxhighlight> |
|
| |
|
| # duply <backupname> create
| | ; Hinweis |
| | : Wenn der Ordner '/etc/duply' existiert, werden die Profile für den Superuser Benutzer root dort gesucht und erstellt werden |
|
| |
|
| Ein duply-Profil wird im Home-Verzeichnis des Benutzers unter '''~/.duply/''' automatisch angelegt und besteht aus den folgenden Dateien:
| | ; Protokolle |
| * gpg-key.asc (Optional, nur wenn ein gpg-key exportiert wurde.)
| | {| class="wikitable options big" |
| * conf
| | ! Protokoll !! Beschreibung |
| * pre und post
| | |- |
| * exclude
| | | [[ftp]] || |
| | |- |
| | | [[ssh]] || |
| | |- |
| | | [[s3]] || |
| | |- |
| | | [[rsync]] || |
| | |- |
| | | [[cifs]] || |
| | |- |
| | | [[webdav]] || |
| | |- |
| | | [[http]] || |
| | |} |
|
| |
|
| ==GPG-Key erstellen== | | == Installation == |
| Während der Erstellung des Keys ist es ratsam andere Arbeiten auf dem Host durchzuführen, um die Entropie am System zu erhöhen, z.B. durch schnelles Bewegen der Maus und/oder das Eintippen auf der Tastatur.
| | <syntaxhighlight lang="bash" highlight="1" line copy> |
|
| | sudo apt install duply |
| Dies beschleunigt das Erstellen des Keys, weil dem Host schneller Zufallswerte (Random) zur Verfügung stehen, die für das Erstellen des Keys benötigt werden.
| | </syntaxhighlight> |
|
| |
|
| Es existieren zwei Varianten, um den GPG-Key zu erstellen.
| | === Dateien === |
| | ; /usr/bin/ |
| | duply |
|
| |
|
| ===Variante 1===
| | ; /usr/share |
| Minimalistisch, es wird nur die minimale Eingbe verlangt und ansonsten die Standardeinstellung verwendet.
| | /doc/duply/ |
| | README |
| | README.Debian |
| | TODO |
| | changelog.Debian.gz |
| | changelog.gz |
| | copyright |
| | systemd-unit.examples |
| | HOWTO.txt |
| | systemd-unit.examples/system/ |
| | duply-backup@.service |
| | duply-backup@.timer |
| | duply-cleanup@.service |
| | duply-cleanup@.timer |
| | duply-verify@.service |
| | duply-verify@.timer |
| | notify-failed-backup@.service |
| | systemd-unit.examples/user/ |
| | duply-backup@.service |
| | duply-backup@.timer |
| | duply-cleanup@.service |
| | duply-cleanup@.timer |
| | duply-verify@.service |
| | duply-verify@.timer |
| | notify-failed-backup@.service |
| | man/man1/ |
| | duply.1.gz |
|
| |
|
| Standardeinstellung:
| | == Aufruf == |
| *Art von Schlüssel: RSA und RSA (öffentlich und privat)
| | === Argumente === |
| *Länge des RSA-Schlüssels: 3072 Bit
| | === Optionen === |
| *Gültigkeit des RSA-Schlüssels: 1 Tag
| | {| class="wikitable options" |
| | | |- |
| # gpg --gen-key
| | ! Option !! Beschreibung |
| | | |- |
| gpg (GnuPG) 2.2.12; Copyright (C) 2018 Free Software Foundation, Inc.
| | | --force || passed to duplicity (see commands purge, purgeFull, purgeIncr, cleanup) |
| This is free software: you are free to change and redistribute it.
| | |- |
| There is NO WARRANTY, to the extent permitted by law.
| | | --preview || do nothing but print out generated duplicity command lines |
|
| | |- |
| gpg: Verzeichnis `/root/.gnupg' erzeugt
| | | --disable-encryption || disable encryption, overrides profile settings |
| gpg: Die "Keybox" `/root/.gnupg/pubring.kbx' wurde erstellt
| | |} |
|
| |
| GnuPG erstellt eine User-ID, um Ihren Schlüssel identifizierbar zu machen.
| |
|
| |
| Ihr Name ("Vorname Nachname"): '''Bobby Hell'''
| |
| Email-Adresse: '''xyz@abc.com'''
| |
| Sie haben diese User-ID gewählt:
| |
| "Bobby Hell <xyz@abc.com>"
| |
|
| |
| Ändern: (N)ame, (E)-Mail oder (F)ertig/(A)bbrechen? '''F'''
| |
| Wir müssen eine ganze Menge Zufallswerte erzeugen. Sie können dies
| |
| unterstützen, indem Sie z.B. in einem anderen Fenster/Konsole irgendetwas
| |
| tippen, die Maus verwenden oder irgendwelche anderen Programme benutzen.
| |
| gpg: /root/.gnupg/trustdb.gpg: trust-db erzeugt
| |
| gpg: Schlüssel 0CF35A314752975A ist als ultimativ vertrauenswürdig gekennzeichnet
| |
| gpg: Verzeichnis `/root/.gnupg/openpgp-revocs.d' erzeugt
| |
| gpg: Widerrufzertifikat wurde als '/root/.gnupg/openpgp-revocs.d/D0B65D93219E4B56E91DEA400CF35A314752975A.rev' gespeichert.
| |
| Öffentlichen und geheimen Schlüssel erzeugt und signiert.
| |
|
| |
| pub rsa3072 2020-08-07 [SC] [verfällt: 2022-08-07]
| |
| D0B65D93219E4B56E91DEA400CF35A314752975A
| |
| uid Bobby Hell <xyz@abc.com>
| |
| sub rsa3072 2020-08-07 [E] [verfällt: 2022-08-07]
| |
| | |
| ===Variante 2=== | |
| | |
| *Maximale Entropie zum Erstellen des Keys.
| |
| *Am sichersten, aber erfordert mehr Zeitaufwand.
| |
| | |
| # gpg --full-generate-key
| |
| | |
| gpg (GnuPG) 2.2.12; Copyright (C) 2018 Free Software Foundation, Inc.
| |
| This is free software: you are free to change and redistribute it.
| |
| There is NO WARRANTY, to the extent permitted by law.
| |
|
| |
| Bitte wählen Sie, welche Art von Schlüssel Sie möchten:
| |
| (1) RSA und RSA (voreingestellt)
| |
| (2) DSA und Elgamal
| |
| (3) DSA (nur signieren/beglaubigen)
| |
| (4) RSA (nur signieren/beglaubigen)
| |
| Ihre Auswahl? '''1'''
| |
| RSA-Schlüssel können zwischen 1024 und 4096 Bit lang sein.
| |
| Welche Schlüssellänge wünschen Sie? (3072) '''4096'''
| |
| Die verlangte Schlüssellänge beträgt 4096 Bit
| |
| Bitte wählen Sie, wie lange der Schlüssel gültig bleiben soll.
| |
| 0 = Schlüssel verfällt nie
| |
| <n> = Schlüssel verfällt nach n Tagen
| |
| <n>w = Schlüssel verfällt nach n Wochen
| |
| <n>m = Schlüssel verfällt nach n Monaten
| |
| <n>y = Schlüssel verfällt nach n Jahren
| |
| Wie lange bleibt der Schlüssel gültig? (0) '''0'''
| |
| Schlüssel verfällt nie
| |
| Ist dies richtig? (j/N) '''j'''
| |
|
| |
| GnuPG erstellt eine User-ID, um Ihren Schlüssel identifizierbar zu machen.
| |
|
| |
| Ihr Name ("Vorname Nachname"): '''Bobby Hell'''
| |
| Email-Adresse: '''xyz@abc.com'''
| |
| Kommentar: '''Es grün so grün, wenn Spaniens Blüten blühn.'''
| |
| Sie benutzen den Zeichensatz `utf-8'
| |
| Sie haben diese User-ID gewählt:
| |
| "Bobby Hell (Es grün so grün, wenn Spaniens Blüten blühn.) <xyz@abc.com>"
| |
|
| |
| Ändern: (N)ame, (K)ommentar, (E)-Mail oder (F)ertig/(A)bbrechen? '''F'''
| |
|
| |
| ┌──────────────────────────────────────────────────────┐
| |
| │ Bitte geben Sie die Passphrase ein, │
| |
| │ um Ihren Schlüssel zu schützen. │
| |
| │ │
| |
| │ Passphrase: **********______________________________ │
| |
| │ │
| |
| │ <OK> <Abbrechen> │
| |
| └──────────────────────────────────────────────────────┘
| |
|
| |
| ┌──────────────────────────────────────────────────────┐
| |
| │ Bitte geben Sie die Passphrase noch einmal ein: │
| |
| │ │
| |
| │ Passphrase: **********______________________________ │
| |
| │ │
| |
| │ <OK> <Abbrechen> │
| |
| └──────────────────────────────────────────────────────┘
| |
|
| |
| Wir müssen eine ganze Menge Zufallswerte erzeugen. Sie können dies
| |
| unterstützen, indem Sie z.B. in einem anderen Fenster/Konsole irgendetwas
| |
| tippen, die Maus verwenden oder irgendwelche anderen Programme benutzen.
| |
| gpg: Schlüssel C676563899DE35FA ist als ultimativ vertrauenswürdig gekennzeichnet
| |
| gpg: Widerrufzertifikat wurde als '/root/.gnupg/openpgp-revocs.d/EECB4BABABB7D22094CDA142C676563899DE35FA.rev' gespeichert.
| |
| Öffentlichen und geheimen Schlüssel erzeugt und signiert.
| |
|
| |
| pub rsa4096 2020-08-07 [SC]
| |
| EECB4BABABB7D22094CDA142C676563899DE35FA
| |
| uid Bobby Hell (Es grünt so grün, wenn Spaniens Blüten blühn.) <xyz@abc.com>
| |
| sub rsa4096 2020-08-07 [E]
| |
| | |
| Passphrase wird nicht im Klartext angezeigt.
| |
| | |
| Als Passphrase wurde '''NerzManta9''' eingegeben.
| |
| | |
| ==conf-Datei== | |
| | |
| Wichtig: Aufbau und Inhalt von automatisch erstellten conf-Dateien können sich teilweise unterscheiden,
| |
| z.B. ist die Liste der unterstützten Protokolle und deren Syntax in manchen mit dabei, bei manchen wiederum nicht.
| |
| | |
| ===Aufrufen der conf-Datei=== | |
| | |
| Hier unter /root/.duply/backup/conf.
| |
| | |
| # vi /root/.duply/backup/conf
| |
| | |
| # gpg encryption settings, simple settings:
| |
| # GPG_KEY='disabled' - disables encryption alltogether
| |
| # GPG_KEY='<key1>[,<key2>]'; GPG_PW='pass' - encrypt with keys,
| |
| # sign if secret key of key1 is available use GPG_PW for sign & decrypt
| |
| # Note: you can specify keys via all methods described in gpg manpage,
| |
| # section "How to specify a user ID", escape commas (,) via backslash (\)
| |
| # e.g. 'Mueller, Horst', 'Bernd' -> 'Mueller\, Horst, Bernd'
| |
| # as they are used to separate the entries
| |
| # GPG_PW='passphrase' - symmetric encryption using passphrase only
| |
| GPG_KEY='_KEY_ID_'
| |
| GPG_PW='_GPG_PASSWORD_'
| |
| # gpg encryption settings in detail (extended settings)
| |
| # the above settings translate to the following more specific settings
| |
| # GPG_KEYS_ENC='<keyid1>[,<keyid2>,...]' - list of pubkeys to encrypt to
| |
| # GPG_KEY_SIGN='<keyid1>|disabled' - a secret key for signing
| |
| # GPG_PW='<passphrase>' - needed for signing, decryption and symmetric
| |
| # encryption. If you want to deliver different passphrases for e.g.
| |
| # several keys or symmetric encryption plus key signing you can use
| |
| # gpg-agent. Simply make sure that GPG_AGENT_INFO is set in environment.
| |
| # also see "A NOTE ON SYMMETRIC ENCRYPTION AND SIGNING" in duplicity manpage
| |
| # notes on en/decryption
| |
| # private key and passphrase will only be needed for decryption or signing.
| |
| # decryption happens on restore and incrementals (compare archdir contents).
| |
| # for security reasons it makes sense to separate the signing key from the
| |
| # encryption keys. <nowiki>https://answers.launchpad.net/duplicity/+question/107216</nowiki>
| |
| #GPG_KEYS_ENC='<pubkey1>,<pubkey2>,...'
| |
| #GPG_KEY_SIGN='<prvkey>'
| |
| # set if signing key passphrase differs from encryption (key) passphrase
| |
| # NOTE: available since duplicity 0.6.14, translates to SIGN_PASSPHRASE
| |
| #GPG_PW_SIGN='<signpass>'
| |
|
| |
| # uncomment and set a file path or name force duply to use this gpg executable
| |
| # available in duplicity 0.7.04 and above (currently unreleased 06/2015)
| |
| #GPG='/usr/local/gpg-2.1/bin/gpg'
| |
|
| |
| # gpg options passed from duplicity to gpg process (default='')
| |
| # e.g. "--trust-model pgp|classic|direct|always"
| |
| # or "--compress-algo=bzip2 --bzip2-compress-level=9"
| |
| # or "--personal-cipher-preferences AES256,AES192,AES..."
| |
| # or "--homedir ~/.duply" - keep keyring and gpg settings duply specific
| |
| # or "--pinentry-mode loopback" - needed for GPG 2.1+ _and_
| |
| # also enable allow-loopback-pinentry in your .gnupg/gpg-agent.conf
| |
| #GPG_OPTS=''
| |
|
| |
| # disable preliminary tests with the following setting
| |
| #GPG_TEST='disabled'
| |
|
| |
| # backend, credentials & location of the backup target (URL-Format)
| |
| # generic syntax is
| |
| # scheme://[user[:password]@]host[:port]/[/]path
| |
| # eg.
| |
| # <nowiki>sftp://bob:secret@backupserver.com//home/bob/dupbkp</nowiki>
| |
| # for details and available backends see duplicity manpage, section URL Format
| |
| # <nowiki>http://duplicity.nongnu.org/duplicity.1.html#sect7</nowiki>
| |
| # listing of some supported protocols and their syntax
| |
| # file://[/absolute_]path
| |
| # ftp[s]://user[:password]@other.host[:port]/some_dir
| |
| # hsi://user[:password]@other.host/some_dir
| |
| # cf+<nowiki>http://container_name</nowiki>
| |
| # imap[s]://user[:password]@host.com[/from_address_prefix]
| |
| # rsync://user[:password]@other.host[:port]::/module/some_dir
| |
| # # rsync over ssh (only keyauth)
| |
| # rsync://user@other.host[:port]/relative_path
| |
| # rsync://user@other.host[:port]//absolute_path
| |
| # # for the s3 user/password are AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
| |
| # s3://[user:password]@host/bucket_name[/prefix]
| |
| # s3+http://[user:password]@bucket_name[/prefix]
| |
| # # scp and sftp are aliases for the ssh backend
| |
| # <nowiki>ssh://user</nowiki>[:password]@other.host[:port]/some_dir
| |
| # tahoe://alias/directory
| |
| # webdav[s]://user[:password]@other.host/some_dir
| |
| # BE AWARE:
| |
| # some backends (cloudfiles, S3 etc.) need additional env vars to be set to
| |
| # work properly, read after the TARGET definition for more details.
| |
| # ATTENTION:
| |
| # characters other than A-Za-z0-9.-_.~ in the URL have to be
| |
| # replaced by their url encoded pendants, see
| |
| # <nowiki>http://en.wikipedia.org/wiki/Url_encoding</nowiki>
| |
| # if you define the credentials as TARGET_USER, TARGET_PASS below duply
| |
| # will try to url_encode them for you if the need arises.
| |
| TARGET='scheme://user[:password]@host[:port]/[/]path'
| |
| # optionally the username/password can be defined as extra variables
| |
| # setting them here _and_ in TARGET results in an error
| |
| # ATTENTION:
| |
| # there are backends that do not support the user/pass auth scheme.
| |
| # prominent examples are S3, Azure, Cloudfiles. when in doubt consult the
| |
| # duplicity manpage. usually there is a NOTE section explaining if and which
| |
| # env vars should be set.
| |
| #TARGET_USER='_backend_username_'
| |
| #TARGET_PASS='_backend_password_'
| |
| # eg. for cloud files backend it might look like this (uncomment for use!)
| |
| #export CLOUDFILES_USERNAME='someuser'
| |
| #export CLOUDFILES_APIKEY='somekey'
| |
| #export CLOUDFILES_AUTHURL ='someurl'
| |
| # the following is an incomplete list (<backend>: comma separated env vars list)
| |
| # Azure: AZURE_ACCOUNT_NAME, AZURE_ACCOUNT_KEY
| |
| # Cloudfiles: CLOUDFILES_USERNAME, CLOUDFILES_APIKEY, CLOUDFILES_AUTHURL
| |
| # Google Cloud Storage: GS_ACCESS_KEY_ID, GS_SECRET_ACCESS_KEY
| |
| # Pydrive: GOOGLE_DRIVE_ACCOUNT_KEY, GOOGLE_DRIVE_SETTINGS
| |
| # S3: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
| |
| # Swift: SWIFT_USERNAME, SWIFT_PASSWORD, SWIFT_AUTHURL,
| |
| # SWIFT_TENANTNAME OR SWIFT_PREAUTHURL, SWIFT_PREAUTHTOKEN
| |
|
| |
| # base directory to backup
| |
| SOURCE='/path/of/source'
| |
|
| |
| # a command that runs duplicity e.g.
| |
| # shape bandwidth use via trickle
| |
| # "trickle -s -u 640 -d 5120" # 5Mb up, 40Mb down"
| |
| #DUPL_PRECMD=""
| |
|
| |
| # override the used python interpreter, defaults to
| |
| # - parsed result of duplicity's shebang or 'python2'
| |
| # e.g. "python2" or "/usr/bin/python2.7"
| |
| #PYTHON="python"
| |
|
| |
| # exclude folders containing exclusion file (since duplicity 0.5.14)
| |
| # Uncomment the following two lines to enable this setting.
| |
| #FILENAME='.duplicity-ignore'
| |
| #DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'"
| |
|
| |
| # Time frame for old backups to keep, Used for the "purge" command.
| |
| # see duplicity man page, chapter TIME_FORMATS)
| |
| #MAX_AGE=1M
| |
|
| |
| # Number of full backups to keep. Used for the "purgeFull" command.
| |
| # See duplicity man page, action "remove-all-but-n-full".
| |
| #MAX_FULL_BACKUPS=1
| |
|
| |
| # Number of full backups for which incrementals will be kept for.
| |
| # Used for the "purgeIncr" command.
| |
| # See duplicity man page, action "remove-all-inc-of-but-n-full".
| |
| #MAX_FULLS_WITH_INCRS=1
| |
|
| |
| # activates duplicity --full-if-older-than option (since duplicity v0.4.4.RC3)
| |
| # forces a full backup if last full backup reaches a specified age, for the
| |
| # format of MAX_FULLBKP_AGE see duplicity man page, chapter TIME_FORMATS
| |
| # Uncomment the following two lines to enable this setting.
| |
| #MAX_FULLBKP_AGE=1M
| |
| #DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE "
| |
|
| |
| # sets duplicity --volsize option (available since v0.4.3.RC7)
| |
| # set the size of backup chunks to VOLSIZE MB instead of the default 25MB.
| |
| # VOLSIZE must be number of MB's to set the volume size to.
| |
| # Uncomment the following two lines to enable this setting.
| |
| #VOLSIZE=50
| |
| #DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE "
| |
|
| |
| # verbosity of output (error 0, warning 1-2, notice 3-4, info 5-8, debug 9)
| |
| # default is 4, if not set
| |
| #VERBOSITY=5
| |
|
| |
| # temporary file space. at least the size of the biggest file in backup
| |
| # for a successful restoration process. (default is '/tmp', if not set)
| |
| #TEMP_DIR=/tmp
| |
|
| |
| # Modifies archive-dir option (since 0.6.0) Defines a folder that holds
| |
| # unencrypted meta data of the backup, enabling new incrementals without the
| |
| # need to decrypt backend metadata first. If empty or deleted somehow, the
| |
| # private key and it's password are needed.
| |
| # NOTE: This is confidential data. Put it somewhere safe. It can grow quite
| |
| # big over time so you might want to put it not in the home dir.
| |
| # default '~/.cache/duplicity/duply_<profile>/'
| |
| # if set '${ARCH_DIR}/<profile>'
| |
| #ARCH_DIR=/some/space/safe/.duply-cache
| |
|
| |
| # DEPRECATED setting
| |
| # sets duplicity --time-separator option (since v0.4.4.RC2) to allow users
| |
| # to change the time separator from ':' to another character that will work
| |
| # on their system. HINT: For Windows SMB shares, use --time-separator='_'.
| |
| # NOTE: '-' is not valid as it conflicts with date separator.
| |
| # ATTENTION: only use this with duplicity < 0.5.10, since then default file
| |
| # naming is compatible and this option is pending depreciation
| |
| #DUPL_PARAMS="$DUPL_PARAMS --time-separator _ "
| |
|
| |
| # DEPRECATED setting
| |
| # activates duplicity --short-filenames option, when uploading to a file
| |
| # system that can't have filenames longer than 30 characters (e.g. Mac OS 8)
| |
| # or have problems with ':' as part of the filename (e.g. Microsoft Windows)
| |
| # ATTENTION: only use this with duplicity < 0.5.10, later versions default file
| |
| # naming is compatible and this option is pending depreciation
| |
| #DUPL_PARAMS="$DUPL_PARAMS --short-filenames "
| |
|
| |
| # more duplicity command line options can be added in the following way
| |
| # don't forget to leave a separating space char at the end
| |
| #DUPL_PARAMS="$DUPL_PARAMS --put_your_options_here "
| |
| | |
| ===Symmetrische Verschlüsselung einrichten===
| |
| | |
| ====Voraussetzung====
| |
| Key-ID und das Passwort des GPG-Keys müssen dafür hinterlegt werden.
| |
| | |
| GPG_KEY='_GPG_KEY_ID_'
| |
| GPG_PW='_GPG_PASSWORD_'
| |
| | |
| ====Key-ID anzeigen lassen====
| |
| | |
| Private-Key
| |
| gpg --list-secret-keys --keyid-format LONG
| |
| | |
| Konsole
| |
| root@linsrv01:~# gpg --list-secret-keys --keyid-format LONG
| |
| gpg: "Trust-DB" wird überprüft
| |
| gpg: marginals needed: 3 completes needed: 1 trust model: pgp
| |
| gpg: Tiefe: 0 gültig: 1 signiert: 0 Vertrauen: 0-, 0q, 0n, 0m, 0f, 1u
| |
| gpg: nächste "Trust-DB"-Pflichtüberprüfung am 2021-11-04
| |
| /root/.gnupg/pubring.kbx
| |
| ------------------------
| |
| sec rsa4096/F47E1B7450082D11 2020-11-04 [SC] [verfällt: 2021-11-04]
| |
| 60E3D3C9ED78CE4A40322BBAF47E1B7450082D11
| |
| uid [ ultimativ ] Robert Quies (Es grünt so grün, wenn Spaniens Blüten blühn.) <raqju@web.de>
| |
| ssb rsa4096/B2E20485FF7FC772 2020-11-04 [E] [verfällt: 2021-11-04]
| |
|
| |
| Public-Key
| |
| gpg --list-keys --keyid-format LONG
| |
| | |
| Konsole
| |
| root@linsrv01:~# gpg --list-keys --keyid-format LONG
| |
| /root/.gnupg/pubring.kbx
| |
| ------------------------
| |
| pub rsa4096/F47E1B7450082D11 2020-11-04 [SC] [verfällt: 2021-11-04]
| |
| 60E3D3C9ED78CE4A40322BBAF47E1B7450082D11
| |
| uid [ ultimativ ] Robert Quies (Es grünt so grün, wenn Spaniens Blüten blühn.) <raqju@web.de>
| |
| sub rsa4096/B2E20485FF7FC772 2020-11-04 [E] [verfällt: 2021-11-04]
| |
| | |
| ===Kompression und Art der Verschlüsselung festlegen===
| |
| | |
| Zusätzlich können in '''GPG_OPTS=''' weitere Optionen zur Kompression und Art der Verschlüsselung gesetzt werden.
| |
| *Es soll mit dem freien Komprimierungsprogramm '''bzip2''' komprimiert werden und dem symmetrischen Verschlüsselungsverfahren '''A'''dvanced '''E'''ncryption '''S'''tandard, auch Rijndael-Algorithmus genannt, mit einer Schlüssellänge von '''256''' verschlüsselt werden.
| |
| | |
| GPG_OPTS='--compress-algo=bzip2 --personal-cipher-preferences AES256'
| |
| | |
| ===De-/Aktivieren der Überprüfung GPG-Key und GPG-Passphrase===
| |
| | |
| duply prüft vor jeder Aktion ob der GPG-Key gültig ist und die Passphrase korrekt ist.
| |
| | |
| Dies kann durch die Option '''GPG_TEST='disabled'''' unterbunden werden.
| |
| | |
| Aktiviert
| |
| GPG_TEST='disabled'
| |
| | |
| Deaktiviert
| |
| # GPG_TEST='disabled'
| |
| | |
| ===Ziel und Quelle des Backups festlegen===
| |
| | |
| ====Allgemeine Syntax des hosts====
| |
| scheme://[user:password@]host[:port]/[/]path
| |
| | |
| ====Protokolle und Syntax zur Datenübertragung====
| |
| duply versteht alle gängigen Protokolle zur Datenübertragung.
| |
| | |
| In der conf-Datei befindet sich meistens eine Liste der wichtigsten unterstützten Protokolle und deren Syntax.
| |
| | |
| # file://[/absolute_]path
| |
| # ftp[s]://user[:password]@other.host[:port]/some_dir
| |
| # hsi://user[:password]@other.host/some_dir
| |
| # cf+<nowiki>http://container_name</nowiki>
| |
| # imap[s]://user[:password]@host.com[/from_address_prefix]
| |
| # rsync://user[:password]@other.host[:port]::/module/some_dir
| |
| # # rsync over ssh (only keyauth)
| |
| # rsync://user@other.host[:port]/relative_path
| |
| # rsync://user@other.host[:port]//absolute_path
| |
| # # for the s3 user/password are AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
| |
| # s3://[user:password]@host/bucket_name[/prefix]
| |
| # s3+http://[user:password]@bucket_name[/prefix]
| |
| # # scp and sftp are aliases for the ssh backend
| |
| # <nowiki>ssh://user</nowiki>[:password]@other.host[:port]/some_dir
| |
| # tahoe://alias/directory
| |
| # webdav[s]://user[:password]@other.host/some_dir
| |
| | |
| Hier ist anzumerken, dass Sonderzeichen [https://de.wikipedia.org/wiki/URL-Encoding urlencoded] eingetragen werden müssen, außer sie werden in den Parametern '''TARGET_USER, TARGET_PASS''' eingetragen.
| |
| | |
| ====Ziel des Backups festlegen====
| |
| | |
| TARGET='scheme://user[:password]@host[:port]/[/]path'
| |
| | |
| *Es soll das Protokoll '''ssh''' zur Datenübertragung genutzt werden.
| |
| *Username: '''user'''
| |
| *Passwort: '''KohlIstKrempe969'''
| |
| *Host: '''foxtom.net'''
| |
| *Port: '''22'''
| |
| *Pfad: '''home/user/backup_PC1'''
| |
| | |
| TARGET='<nowiki>ssh://user:KohlIstKrempe969@foxtom.net:22/home/user/backup_PC1</nowiki>'
| |
| | |
| ====Quelle des Backups festlegen====
| |
| | |
| Root-Verzeichnis für das Backup setzen.
| |
| | |
| SOURCE=
| |
| | |
| Soll ein Backup aus mehreren Unterordnern von '''/''' bestehen (Bsp.: /etc /var /home sollen gesichert werden), so muss die SOURCE Variable auf '''/''' gesetzt werden.''
| |
| | |
| SOURCE='/'
| |
| | |
| In der Regel wird SOURCE='/' gesetzt.
| |
| | |
| Dateien, die in die Sicherung aufgenommen oder von ihr ausgeschlossen werden, werden in der Datei [[Sicherheit:Backup:duply#exclude|'''exclude''']] angegeben.
| |
| | |
| ===Maximales Alter eines Backups festlegen===
| |
| Hier ist anzumerken, dass duply keine Backups löscht, sofern man es nicht anfordert.
| |
| | |
| Mit '''MAX_AGE''' wird das maximale Alter von Backups bestimmt.
| |
| Das älteste Backup soll maximal ein Jahr alt sein.
| |
|
| |
|
| | === Kommandos === |
| | {| class="wikitable sortable options" |
| | |- |
| | ! Option !! Parameter ||Beschreibung |
| | |- |
| | | usage || || get usage help text |
| | |- |
| | | and/or/groupIn/groupOut || || pseudo commands used in batches (see SEPARATORS above) |
| | |- |
| | | create || || creates a configuration profile |
| | |- |
| | | backup || || backup with pre/post script execution (batch: [pre_bkp_post]), full (if full_if_older matches or no earlier backup is found) incremental (in all other cases) |
| | |- |
| | | pre/post || ||execute '<profile>/pre', '<profile>/post' scripts |
| | |- |
| | | bkp || || as above but without executing pre/post scripts |
| | |- |
| | | full || ||force full backup |
| | |- |
| | | incr || || force incremental backup |
| | |- |
| | | list || [<age>] || list all files in backup (as it was at <age>, default: now) |
| | |- |
| | | status || || prints backup sets and chains currently in repository |
| | |- |
| | | verify || [<age>] [--compare-data] || list files changed, since age if given |
| | |- |
| | | verifyPath || <rel_path_in_bkp> <local_path> [<age>] [--compare-data] || list changes of a file or folder path in backup compared to a local path, since age if given |
| | |- |
| | | restore || <target_path> [<age>] || restore the complete backup to <target_path> [as it was at <age>] |
| | |- |
| | | fetch || <src_path> <target_path> [<age>] || fetch single file/folder from backup [as it was at <age>] |
| | |- |
| | | purge || [<max_age>] [--force] || list outdated backup files (older than $MAX_AGE) [use --force to actually delete these files] |
| | |- |
| | | purgeFull || [<max_full_backups>] [--force] || list outdated backup files ($MAX_FULL_BACKUPS being the number of full backups and associated incrementals to keep, counting in reverse chronological order) [use --force to actually delete these files] |
| | |- |
| | | purgeIncr || [<max_fulls_with_incrs>] [--force] || list outdated incremental backups ($MAX_FULLS_WITH_INCRS being the number of full backups which associated incrementals will be kept, counting in reverse chronological order) [use --force to actually delete these files] |
| | |- |
| | | purgeAuto || [--force] || convenience batch wrapper for all purge commands above |
| | * purge, purgeFull, purgeIncr are added if their conf vars were set |
| | * e.g |
| MAX_AGE=1Y | | MAX_AGE=1Y |
| | MAX_FULL_BACKUPS=6 |
| | MAX_FULLS_WITH_INCR=3 |
| | in profile conf file would result in |
| | [purge_purgeFull_purgeIncr] |
| | |- |
| | | cleanup || [--force] || list broken backup chain files archives (e.g |
| | * after unfinished run) [use --force to actually delete these files] |
| | |- |
| | | changelog || || print changelog / todo list |
| | |- |
| | | txt2man || || feature for package maintainers - create a manpage based on the usage output |
| | * download txt2man from https://mvertes.free.fr/, put it in the PATH and run 'duply txt2man' to create a man page |
| | |- |
| | | version || || show version information of duply and needed programs |
| | |} |
|
| |
|
| ===Anzahl der vollständigen Backups festlegen=== | | === Umgebung === |
| | | === Rückgabewert === |
| Mit '''MAX_FULL_BACKUPS''' kann bestimmt werden, wie viele Full-Backups duply maximal behält.
| |
| | |
| Es sollen fünf sein.
| |
| | |
| MAX_FULL_BACKUPS=5
| |
| | |
| ===Maximales Alter der vollständigen Backups festlegen===
| |
| | |
| Alternativ kann mit '''MAX_FULLBKP_AGE''' spezifiert werden, wie alt ein Full-Backup sein darf, bevor ein neues Full-Backup erstellt wird.
| |
| | |
| Es soll zwei Wochen alt sein.
| |
| | |
| MAX_FULLBKP_AGE=2W
| |
| DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE"
| |
| | |
| ===Größe der Backup-Pakete bei der Übertragung ändern===
| |
| | |
| Um den durch eventuelle Übertragungsfehler entstehenden Zeitverlust einzuschränken, teilt duply standardmäßig seine Backups in 25 MB große Dateien.
| |
| | |
| Dies kann mit '''VOLSIZE''' geändert werden.
| |
| | |
| Backup-Pakete sollen 10 MB groß sein.
| |
| | |
| VOLSIZE=10
| |
| DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE"
| |
| | |
| ===Anwendung===
| |
| *Beide Variaten sind funktional identisch.
| |
| | |
| ====minimal====
| |
| '''GPG_KEY='C676563899DE35FA''''
| |
| '''GPG_PW='NerzManta9''''
| |
| '''GPG_OPTS='--compress-algo=bzip2 --personal-cipher-preferences AES256''''
| |
| '''GPG_TEST='disabled''''
| |
| '''TARGET='<nowiki>ssh://user:KohlIstKrempe969@foxtom.net:22/home/user/backup_PC1</nowiki>''''
| |
| '''SOURCE='/''''
| |
| '''MAX_AGE=1Y'''
| |
| '''MAX_FULL_BACKUPS=5'''
| |
| '''MAX_FULLBKP_AGE=2W'''
| |
| '''DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE"'''
| |
| '''VOLSIZE=10'''
| |
| '''DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE"'''
| |
|
| |
| ====komplett====
| |
| # gpg encryption settings, simple settings:
| |
| # GPG_KEY='disabled' - disables encryption alltogether
| |
| # GPG_KEY='<key1>[,<key2>]'; GPG_PW='pass' - encrypt with keys,
| |
| # sign if secret key of key1 is available use GPG_PW for sign & decrypt
| |
| # Note: you can specify keys via all methods described in gpg manpage,
| |
| # section "How to specify a user ID", escape commas (,) via backslash (\)
| |
| # e.g. 'Mueller, Horst', 'Bernd' -> 'Mueller\, Horst, Bernd'
| |
| # as they are used to separate the entries
| |
| # GPG_PW='passphrase' - symmetric encryption using passphrase only
| |
| '''GPG_KEY='C676563899DE35FA''''
| |
| '''GPG_PW='NerzManta9''''
| |
| # gpg encryption settings in detail (extended settings)
| |
| # the above settings translate to the following more specific settings
| |
| # GPG_KEYS_ENC='<keyid1>[,<keyid2>,...]' - list of pubkeys to encrypt to
| |
| # GPG_KEY_SIGN='<keyid1>|disabled' - a secret key for signing
| |
| # GPG_PW='<passphrase>' - needed for signing, decryption and symmetric
| |
| # encryption. If you want to deliver different passphrases for e.g.
| |
| # several keys or symmetric encryption plus key signing you can use
| |
| # gpg-agent. Simply make sure that GPG_AGENT_INFO is set in environment.
| |
| # also see "A NOTE ON SYMMETRIC ENCRYPTION AND SIGNING" in duplicity manpage
| |
| # notes on en/decryption
| |
| # private key and passphrase will only be needed for decryption or signing.
| |
| # decryption happens on restore and incrementals (compare archdir contents).
| |
| # for security reasons it makes sense to separate the signing key from the
| |
| # encryption keys. <nowiki>https://answers.launchpad.net/duplicity/+question/107216</nowiki>
| |
| # GPG_KEYS_ENC='<pubkey1>,<pubkey2>,...'
| |
| # GPG_KEY_SIGN='<prvkey>'
| |
| # set if signing key passphrase differs from encryption (key) passphrase
| |
| # NOTE: available since duplicity 0.6.14, translates to SIGN_PASSPHRASE
| |
| # GPG_PW_SIGN='<signpass>'
| |
|
| |
| # uncomment and set a file path or name force duply to use this gpg executable
| |
| # available in duplicity 0.7.04 and above (currently unreleased 06/2015)
| |
| # GPG='/usr/local/gpg-2.1/bin/gpg'
| |
|
| |
| # gpg options passed from duplicity to gpg process (default='')
| |
| # e.g. "--trust-model pgp|classic|direct|always"
| |
| # or "--compress-algo=bzip2 --bzip2-compress-level=9"
| |
| # or "--personal-cipher-preferences AES256,AES192,AES..."
| |
| # or "--homedir ~/.duply" - keep keyring and gpg settings duply specific
| |
| # or "--pinentry-mode loopback" - needed for GPG 2.1+ _and_
| |
| # also enable allow-loopback-pinentry in your .gnupg/gpg-agent.conf
| |
| '''GPG_OPTS='--compress-algo=bzip2 --personal-cipher-preferences AES256''''
| |
|
| |
| # disable preliminary tests with the following setting
| |
| '''GPG_TEST='disabled''''
| |
|
| |
| # backend, credentials & location of the backup target (URL-Format)
| |
| # generic syntax is
| |
| # scheme://[user[:password]@]host[:port]/[/]path
| |
| # eg.
| |
| # <nowiki>sftp://bob:secret@backupserver.com//home/bob/dupbkp</nowiki>
| |
| # for details and available backends see duplicity manpage, section URL Format
| |
| # <nowiki>http://duplicity.nongnu.org/duplicity.1.html#sect7</nowiki>
| |
| # listing of some supported protocols and their syntax
| |
| # file://[/absolute_]path
| |
| # ftp[s]://user[:password]@other.host[:port]/some_dir
| |
| # hsi://user[:password]@other.host/some_dir
| |
| # cf+<nowiki>http://container_name</nowiki>
| |
| # imap[s]://user[:password]@host.com[/from_address_prefix]
| |
| # rsync://user[:password]@other.host[:port]::/module/some_dir
| |
| # # rsync over ssh (only keyauth)
| |
| # rsync://user@other.host[:port]/relative_path
| |
| # rsync://user@other.host[:port]//absolute_path
| |
| # # for the s3 user/password are AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
| |
| # s3://[user:password]@host/bucket_name[/prefix]
| |
| # s3+http://[user:password]@bucket_name[/prefix]
| |
| # # scp and sftp are aliases for the ssh backend
| |
| # <nowiki>ssh://user</nowiki>[:password]@other.host[:port]/some_dir
| |
| # tahoe://alias/directory
| |
| # webdav[s]://user[:password]@other.host/some_dir
| |
| # BE AWARE:
| |
| # some backends (cloudfiles, S3 etc.) need additional env vars to be set to
| |
| # work properly, read after the TARGET definition for more details.
| |
| # ATTENTION:
| |
| # characters other than A-Za-z0-9.-_.~ in the URL have to be
| |
| # replaced by their url encoded pendants, see
| |
| # <nowiki>http://en.wikipedia.org/wiki/Url_encoding</nowiki>
| |
| # if you define the credentials as TARGET_USER, TARGET_PASS below duply
| |
| # will try to url_encode them for you if the need arises.
| |
| '''TARGET='<nowiki>ssh://user:KohlIstKrempe969@foxtom.net:22/home/user/backup_PC1</nowiki>''''
| |
| # optionally the username/password can be defined as extra variables
| |
| # setting them here _and_ in TARGET results in an error
| |
| # ATTENTION:
| |
| # there are backends that do not support the user/pass auth scheme.
| |
| # prominent examples are S3, Azure, Cloudfiles. when in doubt consult the
| |
| # duplicity manpage. usually there is a NOTE section explaining if and which
| |
| # env vars should be set.
| |
| #TARGET_USER='_backend_username_'
| |
| #TARGET_PASS='_backend_password_'
| |
| # eg. for cloud files backend it might look like this (uncomment for use!)
| |
| #export CLOUDFILES_USERNAME='someuser'
| |
| #export CLOUDFILES_APIKEY='somekey'
| |
| #export CLOUDFILES_AUTHURL ='someurl'
| |
| # the following is an incomplete list (<backend>: comma separated env vars list)
| |
| # Azure: AZURE_ACCOUNT_NAME, AZURE_ACCOUNT_KEY
| |
| # Cloudfiles: CLOUDFILES_USERNAME, CLOUDFILES_APIKEY, CLOUDFILES_AUTHURL
| |
| # Google Cloud Storage: GS_ACCESS_KEY_ID, GS_SECRET_ACCESS_KEY
| |
| # Pydrive: GOOGLE_DRIVE_ACCOUNT_KEY, GOOGLE_DRIVE_SETTINGS
| |
| # S3: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
| |
| # Swift: SWIFT_USERNAME, SWIFT_PASSWORD, SWIFT_AUTHURL,
| |
| # SWIFT_TENANTNAME OR SWIFT_PREAUTHURL, SWIFT_PREAUTHTOKEN
| |
|
| |
| # base directory to backup
| |
| '''SOURCE='/''''
| |
|
| |
| # a command that runs duplicity e.g.
| |
| # shape bandwidth use via trickle
| |
| # "trickle -s -u 640 -d 5120" # 5Mb up, 40Mb down"
| |
| #DUPL_PRECMD=""
| |
|
| |
| # override the used python interpreter, defaults to
| |
| # - parsed result of duplicity's shebang or 'python2'
| |
| # e.g. "python2" or "/usr/bin/python2.7"
| |
| #PYTHON="python"
| |
|
| |
| # exclude folders containing exclusion file (since duplicity 0.5.14)
| |
| # Uncomment the following two lines to enable this setting.
| |
| #FILENAME='.duplicity-ignore'
| |
| #DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'"
| |
|
| |
| # Time frame for old backups to keep, Used for the "purge" command.
| |
| # see duplicity man page, chapter TIME_FORMATS)
| |
| '''MAX_AGE=1Y'''
| |
|
| |
| # Number of full backups to keep. Used for the "purgeFull" command.
| |
| # See duplicity man page, action "remove-all-but-n-full".
| |
| '''MAX_FULL_BACKUPS=5'''
| |
|
| |
| # Number of full backups for which incrementals will be kept for.
| |
| # Used for the "purgeIncr" command.
| |
| # See duplicity man page, action "remove-all-inc-of-but-n-full".
| |
| #MAX_FULLS_WITH_INCRS=1
| |
|
| |
| # activates duplicity --full-if-older-than option (since duplicity v0.4.4.RC3)
| |
| # forces a full backup if last full backup reaches a specified age, for the
| |
| # format of MAX_FULLBKP_AGE see duplicity man page, chapter TIME_FORMATS
| |
| # Uncomment the following two lines to enable this setting.
| |
| '''MAX_FULLBKP_AGE=2W'''
| |
| '''DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE"'''
| |
|
| |
| # sets duplicity --volsize option (available since v0.4.3.RC7)
| |
| # set the size of backup chunks to VOLSIZE MB instead of the default 25MB.
| |
| # VOLSIZE must be number of MB's to set the volume size to.
| |
| # Uncomment the following two lines to enable this setting.
| |
| '''VOLSIZE=10'''
| |
| '''DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE"'''
| |
|
| |
| # verbosity of output (error 0, warning 1-2, notice 3-4, info 5-8, debug 9)
| |
| # default is 4, if not set
| |
| #VERBOSITY=5
| |
|
| |
| # temporary file space. at least the size of the biggest file in backup
| |
| # for a successful restoration process. (default is '/tmp', if not set)
| |
| #TEMP_DIR=/tmp
| |
|
| |
| # Modifies archive-dir option (since 0.6.0) Defines a folder that holds
| |
| # unencrypted meta data of the backup, enabling new incrementals without the
| |
| # need to decrypt backend metadata first. If empty or deleted somehow, the
| |
| # private key and it's password are needed.
| |
| # NOTE: This is confidential data. Put it somewhere safe. It can grow quite
| |
| # big over time so you might want to put it not in the home dir.
| |
| # default '~/.cache/duplicity/duply_<profile>/'
| |
| # if set '${ARCH_DIR}/<profile>'
| |
| #ARCH_DIR=/some/space/safe/.duply-cache
| |
|
| |
| # DEPRECATED setting
| |
| # sets duplicity --time-separator option (since v0.4.4.RC2) to allow users
| |
| # to change the time separator from ':' to another character that will work
| |
| # on their system. HINT: For Windows SMB shares, use --time-separator='_'.
| |
| # NOTE: '-' is not valid as it conflicts with date separator.
| |
| # ATTENTION: only use this with duplicity < 0.5.10, since then default file
| |
| # naming is compatible and this option is pending depreciation
| |
| #DUPL_PARAMS="$DUPL_PARAMS --time-separator _ "
| |
|
| |
| # DEPRECATED setting
| |
| # activates duplicity --short-filenames option, when uploading to a file
| |
| # system that can't have filenames longer than 30 characters (e.g. Mac OS 8)
| |
| # or have problems with ':' as part of the filename (e.g. Microsoft Windows)
| |
| # ATTENTION: only use this with duplicity < 0.5.10, later versions default file
| |
| # naming is compatible and this option is pending depreciation
| |
| #DUPL_PARAMS="$DUPL_PARAMS --short-filenames "
| |
|
| |
| # more duplicity command line options can be added in the following way
| |
| # don't forget to leave a separating space char at the end
| |
| #DUPL_PARAMS="$DUPL_PARAMS --put_your_options_here "
| |
| | |
| ==Pre- und Post-Skripte==
| |
| | |
| duply erlaubt die Verwendung von Pre- und Post-Skripten.
| |
| | |
| Das pre-Skript wird direkt vor dem Backup ausgeführt, das post-Skript direkt nach dem Backup.
| |
| | |
| Mit diesen Skripten können beispielsweise Snapshots von LVM-Volumes oder Dumps von SQL Datenbanken gemacht und in das Backup einbezogen werden.
| |
| | |
| Die files <tt>pre</tt> und <tt>post</tt> müssen im jeweiligen duply Verzeichnis liegen (Bsp.: /home/user/.duply/backup/) und ausführbar sein.
| |
| | |
| Werden die pre/post Scripte nicht wie erhofft ausgeführt (z.B. bei den Sicherchungs-Methoden "full/incr"), können diese explizit angegeben werden: <tt>pre_incr_post</tt>
| |
| | |
| ===Beispiel===
| |
| Hier ein Beispiel für ein PRE/POST Skript welches vor dem Backup einen SQL-Dump aller Datenbanken erstellt und diesen nach dem Backup wieder löscht.
| |
| | |
| ====pre-Datei====
| |
| | |
| /usr/bin/mysqldump --all-databases -u root -ppw> /tmp/sqldump-$(date '+%F')
| |
| | |
| ====post-Datei====
| |
| | |
| /bin/rm /tmp/sqldump-$(date '+%F')
| |
| | |
| ==exclude==
| |
| | |
| duply arbeitet standardmäßig mit einer Whitelist.
| |
| | |
| Um gewisse Verzeichnisse oder Dateien von einem Backup zu inkludieren muss die Datei <tt>exclude</tt> im duply Verzeichnis erstellt werden.
| |
| | |
| Die Syntax erlaubt das Hinzufügen von Verzeichnissen und Dateien mit einem <tt>+ /pfad/zur/datei</tt>.
| |
| | |
| Um ein Verzeichnis zu exkludieren muss in der <tt>exclude</tt> ein <tt>- /pfad/zum/Verzeichnis</tt> eingefügt werden.
| |
| | |
| Zudem erlaubt duply die Verwendung von Wildcards.
| |
| | |
| Die hier dargestellte <tt>exclude</tt> Datei sichert die Verzeichnisse <tt>/etc/, /root/, /var/www/</tt> und exkludiert alle anderen Verzeichnisse.
| |
| | |
| + /etc/
| |
| + /root/
| |
| + /var/www/
| |
| - **
| |
| | |
| ==Parameter==
| |
| | |
| duply bietet eine Vielzahl von Kommandozeilenparametern für die Sicherung und Wiederherstellung von Daten.
| |
| | |
| Die gesamte Liste ist in der Manpage von duply zu finden.
| |
| | |
| Beim Einsatz von mehreren Parameter werden diese durch einen Unterstrich ('''_''') getrennt.
| |
| | |
| Mit <tt>/usr/bin/duply /root/.duply/test full_verify_purge --force</tt> wird ein volles Backup erstellt, verifiziert und alte Backups gelöscht.
| |
| | |
| Backups welche die <tt>MAX_AGE</tt> überschritten haben werden mit <tt>purge</tt> angezeigt und durch die zusätzliche Option <tt>--force</tt> gelöscht.
| |
| | |
| Der Befehl <tt>/usr/bin/duply /root/.duply/test incr</tt> führt ein inkrementelles Backup aus.
| |
| | |
| ==cronjob==
| |
| | |
| Bei duply handelt es sich nicht um einen Dienst (Daemon), sondern um ein Skript, das z.B. regelmäßig via Cron ausgeführt werden kann.
| |
| | |
| Eine Beispielhafte cronjob-Konfiguration wäre:
| |
| | |
| 0 0 * * 7 /usr/bin/duply /root/.duply/test full_verify_purge --force
| |
| 0 0 * * 1-6 /usr/bin/duply /root/.duply/test incr
| |
| | |
| In dieser Konfiguration wird Sonntags um 0:00 ein Full-Backup erstellt und alte Backups gelöscht.
| |
| | |
| Montag bis Samstag wird jeden Tag ein inkrementelles Backup durchgeführt.
| |
| | |
| Neue cronjobs können mit '''crontab -e''' erstellt werden.
| |
| | |
| Hier ist anzumerken, dass für alle Kommandos und Konfigurationsdateien der absolute Pfad angegeben werden muss.
| |
| | |
| =Fehlermeldungen= | |
|
| |
|
| Meldung
| |
| [GNUPG:] PINENTRY_LAUNCHED 23758 curses 1.1.0 - linux -
| |
| gpg: Beglaubigung fehlgeschlagen: Unpassender IOCTL (I/O-Control) für das Gerät
| |
| [GNUPG:] BEGIN_ENCRYPTION 2 9
| |
| [GNUPG:] FAILURE sign-encrypt 83918950
| |
| gpg: /usr/bin/duply: sign+encrypt failed: Unpassender IOCTL (I/O-Control) für das Gerät
| |
|
| |
|
| Lösung
| | <noinclude> |
| echo use-agent >> ~/.gnupg/gpg.conf
| |
| echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
| |
| echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
| |
|
| |
|
| Hintergrund
| | == Anhang == |
| Es kommt zu dieser Fehlermeldung, weil gpg die Passphrase nicht automatisch abfragen konnte.
| | === Siehe auch === |
| Die erledigt der gpg-agent, der wiederum [[Sicherheit:pinentry-curses|pinentry-curses]] zur sicheren Übertragung der Passphrase vewendet.
| | {{Special:PrefixIndex/{{BASEPAGENAME}}/}} |
| In der gpg.conf muss angegeben werden, dass der gpg-agent verwendet werden soll (use-agent).
| | ---- |
| Und in welchem Modus dieser verwendet werden soll (pinentry-mode loopback).
| | * [[GnuPG]] |
| In der gpg-agent.conf muss dem gpg-agent erlaubt werden den loop-back-pinentry durchzuführen.
| | * [[GnuPG-Agent]] |
| | * [[pinentry-curses]] |
| | * [[duplicity]] |
|
| |
|
| =Weitere Informationen= | | ==== Sicherheit ==== |
| *[[Sicherheit:Verschlüsselung:GPG]]
| | === Dokumentation === |
| *[[Sicherheit:Verschlüsselung:GPG-Agent]]
| | === Links === |
| *[[Sicherheit:pinentry-curses]]
| | ==== Projekt ==== |
| | ==== Weblinks ==== |
| | # [https://www.thomas-krenn.com/de/wiki/Backup_unter_Linux_mit_duply https://www.thomas-krenn.com/de/wiki/Backup_unter_Linux_mit_duply] |
| | # [https://wiki.archlinux.org/index.php/Duply#Configuration https://wiki.archlinux.org/index.php/Duply#Configuration] |
| | # [https://www.gnupg.org/howtos/de/GnuPGMiniHowto.html https://www.gnupg.org/howtos/de/GnuPGMiniHowto.html] |
| | # [https://duply.net/ duply.net] |
|
| |
|
| =Quellen=
| | [[Kategorie:duply]] |
|
| |
|
| *[https://www.thomas-krenn.com/de/wiki/Backup_unter_Linux_mit_duply https://www.thomas-krenn.com/de/wiki/Backup_unter_Linux_mit_duply]
| | {{DISPLAYTITLE:duply}} |
| *[https://wiki.archlinux.org/index.php/Duply#Configuration https://wiki.archlinux.org/index.php/Duply#Configuration]
| |
| *[https://www.gnupg.org/howtos/de/GPGMiniHowto.html https://www.gnupg.org/howtos/de/GPGMiniHowto.html]
| |
| *[http://duply.net/ duply.net]
| |
|
| |
|
| [[Category:Sicherheit:Backup]]
| | </noinclude> |
| [[Category:Sicherheit]] | | [[Kategorie:Linux/Befehl]] |