Duplicity: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Installation == See [https://help.ubuntu.com/community/DuplicityBackupHowto DuplicityBackupHowto].") |
No edit summary |
||
Line 1: | Line 1: | ||
== Installation == |
== Installation == |
||
See [https://help.ubuntu.com/community/DuplicityBackupHowto DuplicityBackupHowto]. |
See [https://help.ubuntu.com/community/DuplicityBackupHowto DuplicityBackupHowto]. |
||
=== Basic usage === |
|||
;Basic backup: |
|||
<source lang=bash> |
|||
export PASSPHRASE=SomeLongGeneratedHardToCrackKey |
|||
export FTP_PASSWORD=WhateverPasswordYouSetUp |
|||
duplicity /etc ftp://FtpUserID@ftp.domain.com/etc |
|||
unset PASSPHRASE |
|||
unset FTP_PASSWORD |
|||
</source> |
|||
(or change ftp URL: to {{file|file:///my/filesystem/path}}). |
|||
;Basic verify (compare): |
|||
<source lang=bash> |
|||
export PASSPHRASE=SomeLongGeneratedHardToCrackKey |
|||
export FTP_PASSWORD=WhateverPasswordYouSetUp |
|||
duplicity verify ftp://FtpUserID@ftp.domain.com/etc /etc |
|||
unset PASSPHRASE |
|||
unset FTP_PASSWORD |
|||
</source> |
|||
;Basic file listing: |
|||
<source lang=bash> |
|||
# ... |
|||
duplicity list-current-files ftp://FtpUserID@ftp.domain.com/etcunset PASSPHRASE |
|||
# ... |
|||
</source> |
|||
;Basic restore |
|||
<source lang=bash> |
|||
# ... |
|||
duplicity --file-to-restore apt/sources.list ftp://FtpUserID@ftp.domain.com/etc /home/user/sources.list |
|||
# ... |
|||
</source> |
|||
=== Cron script === |
|||
<source lang=bash> |
|||
export PASSPHRASE=(insert your value here) |
|||
export FTP_PASSWORD=(insert your value here) |
|||
# doing a monthly full backup (1M) |
|||
duplicity --full-if-older-than 1M /etc ftp://(insert your FTP server here)/etc |
|||
# exclude /var/tmp from the backup |
|||
duplicity --full-if-older-than 1M --exclude /var/tmp /var ftp://(insert your FTP server here)/var |
|||
duplicity --full-if-older-than 1M /root ftp://(insert your FTP server here)/root |
|||
# cleaning the remote backup space (deleting backups older than 6 months (6M, alternatives would 1Y fo 1 year etc.) |
|||
duplicity remove-older-than 6M --force ftp://(insert your FTP server here)/etc |
|||
duplicity remove-older-than 6M --force ftp://(insert your FTP server here)/var |
|||
duplicity remove-older-than 6M --force ftp://(insert your FTP server here)/root |
|||
unset PASSPHRASE |
|||
unset FTP_PASSWORD |
|||
</source> |
|||
Install in crontab (<code>crontab -e</code>) by adding line: |
|||
0 0 * * * /root/scripts/etc/backup.sh >>/var/log/duplicity/etc.log |
Revision as of 18:53, 10 December 2015
Installation
See DuplicityBackupHowto.
Basic usage
- Basic backup
export PASSPHRASE=SomeLongGeneratedHardToCrackKey
export FTP_PASSWORD=WhateverPasswordYouSetUp
duplicity /etc ftp://FtpUserID@ftp.domain.com/etc
unset PASSPHRASE
unset FTP_PASSWORD
(or change ftp URL: to file:///my/filesystem/path).
- Basic verify (compare)
export PASSPHRASE=SomeLongGeneratedHardToCrackKey
export FTP_PASSWORD=WhateverPasswordYouSetUp
duplicity verify ftp://FtpUserID@ftp.domain.com/etc /etc
unset PASSPHRASE
unset FTP_PASSWORD
- Basic file listing
# ...
duplicity list-current-files ftp://FtpUserID@ftp.domain.com/etcunset PASSPHRASE
# ...
- Basic restore
# ...
duplicity --file-to-restore apt/sources.list ftp://FtpUserID@ftp.domain.com/etc /home/user/sources.list
# ...
Cron script
export PASSPHRASE=(insert your value here)
export FTP_PASSWORD=(insert your value here)
# doing a monthly full backup (1M)
duplicity --full-if-older-than 1M /etc ftp://(insert your FTP server here)/etc
# exclude /var/tmp from the backup
duplicity --full-if-older-than 1M --exclude /var/tmp /var ftp://(insert your FTP server here)/var
duplicity --full-if-older-than 1M /root ftp://(insert your FTP server here)/root
# cleaning the remote backup space (deleting backups older than 6 months (6M, alternatives would 1Y fo 1 year etc.)
duplicity remove-older-than 6M --force ftp://(insert your FTP server here)/etc
duplicity remove-older-than 6M --force ftp://(insert your FTP server here)/var
duplicity remove-older-than 6M --force ftp://(insert your FTP server here)/root
unset PASSPHRASE
unset FTP_PASSWORD
Install in crontab (crontab -e
) by adding line:
0 0 * * * /root/scripts/etc/backup.sh >>/var/log/duplicity/etc.log