Zum Inhalt springen

Duply/Konfiguration

Aus Foxwiki
Die 5 zuletzt angesehenen Seiten:  Seminar/Apache/Webserver/Inhalte » Minidlna » LPIC101/104.1 Partitionen und Dateisyste... » Duply/Konfiguration
Version vom 1. Mai 2025, 11:47 Uhr von Dirkwagner (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Konfiguration == === Kryptografie === GnuPG-Schlüssel erstellen === Profile === * Indicated by a path or a profile name (<profile>), which is resolved to '~/.duply/<profile>' (~ expands to environment variable $HOME). * Superuser root can place profiles under '/etc/duply'. Simply create the folder manually before running duply as superuser. ; Note : Already existing profiles in root's home folder will cease to work unless they…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Konfiguration

Kryptografie

GnuPG-Schlüssel erstellen

Profile

  • Indicated by a path or a profile name (<profile>), which is resolved to '~/.duply/<profile>' (~ expands to environment variable $HOME).
  • Superuser root can place profiles under '/etc/duply'. Simply create the folder manually before running duply as superuser.
Note
Already existing profiles in root's home folder will cease to work unless they are moved to the new location manually.
Example 1
duply humbug backup

Alternatively a _path_ might be used e.g. useful for quick testing, restoring or exotic locations. Shell expansion should work as usual.

Hint
The path must contain at least one path separator '/', e.g. './test' instead of only 'test'.
Example 2
duply ~/.duply/humbug backup

Profil erstellen

# duply <backupname> create

Ein duply-Profil wird im Home-Verzeichnis des Benutzers unter ~/.duply/ angelegt und besteht aus den folgenden Dateien:

  • gpg-key.asc (nur wenn ein gpg-key exportiert wurde)
  • conf
  • pre und post
  • exclude

Konfiguration

Kryptografie einrichten

Voraussetzung

Key-ID und das Passwort des GnuPG-Keys müssen dafür hinterlegt werden

GnuPG_KEY='_GnuPG_KEY_ID_'
GnuPG_PW='_GnuPG_PASSWORD_'
Key-ID anzeigen lassen
Private-Key
# 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]
# 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 Kryptografie

GnuPG_OPTS

Optionen zur Kompression und Art der Kryptografie

  • bzip2 komprimiert
  • Advanced Encryption Standard, auch Rijndael-Algorithmus mit einer Schlüssellänge von 256 werden
GnuPG_OPTS='--compress-algo=bzip2 --personal-cipher-preferences AES256'

Prüfen der GnuPG-Key und GnuPG-Passphrase

De-/Aktivieren der Überprüfung GnuPG-Key und GnuPG-Passphrase
  • duply prüft vor jeder Aktion ob der GnuPG-Key gültig ist und die Passphrase korrekt ist.
  • Dies kann durch die Option GnuPG_TEST='disabled' unterbunden werden.
Aktiviert
GnuPG_TEST='disabled'
Deaktiviert
# GnuPG_TEST='disabled'

Ziel und Quelle des Backups

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+https://container_name
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+https://[user:password]@bucket_name[/prefix]
scp and sftp are aliases for the ssh backend
ssh://user</nowiki>[:password]@other.host[:port]/some_dir
tahoe://alias/directory
webdav[s]://user[:password]@other.host/some_dir
Hinweis
Sonderzeichen müssen urlencoded eingetragen werden, außer bei den Parametern TARGET_USER, TARGET_PASS
Ziel des Backups
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='ssh://user:KohlIstKrempe969@foxtom.net:22/home/user/backup_PC1'
Quelle des Backups

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 exclude angegeben.

Maximales Alter eines Backups

Hinweis
duply löscht keine Backups, sofern man es nicht anfordert

Mit MAX_AGE wird das maximale Alter von Backups bestimmt. Das älteste Backup soll maximal ein Jahr alt sein.

MAX_AGE=1Y

Anzahl der vollständigen Backups

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

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

Um den durch eventuelle Übertragungsfehler entstehenden Zeitverlust einzuschränken, teilt duply standardmäßig seine Backups in 25 MB große Dateien. Mit VOLSIZE kann die Größe der erstellten Backup-Pakete geändert werden.

Der gewünschte Wert hängt von verschieden Faktoren ab.

  • Übertragungsgeschwindigkeit
  • Systembelastung
  • Netzwerkbelastung

Vor-/Nachteile

  • Vorteil kleine Pakete
  • Vorteil große Pakete
  • Nachteil kleine Pakete
  • Nachteil große Pakete
Beispiel

Backup-Pakete sollen 10 MB groß sein

VOLSIZE=10
DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE"

Asynchrone Uploads

Asynchrone Uploads erlauben das Erstellen neuer Archive, bevor bereits erstellte auf den Server geladen wurden.

  • Schnelleres Backup
  • Hohe System- und hohe Netzlast

Asynchrone Uploads aktivieren

DUPL_PARAMS="$DUPL_PARAMS --asynchronous-upload"

Dateien

Profile folder
Option Beschreibung
/etc/duply
~/.duply/<profile>
Profile files
Option Beschreibung
conf profile configuration file
pre,post pre/post scripts (see above for details)
gpgkey.*.asc exported GnuPG key files
exclude a globbing list of included or excluded files/folders (see "duplicity manpage", section FILE SELECTION)