dt-cf-backup
dt-cf-backup copied to clipboard
A fork of dt-s3-backup to use with Rackspace Cloud Files
ABOUT THIS SCRIPT
This bash script is a fork of the excellent dt-s3-backup to work with Rackspace Cloud Files all kudos goes to thornomad for this good work I have just made it to work with Rackspace CloudFiles.
This bash script was designed to automate and simplify the remote backup process of duplicity on Rackspace Cloud Files . After your script is configured, you can easily backup, restore, verify and clean (either via cron or manually) your data without having to remember lots of different command options and passphrases.
Most importantly, you can easily backup the script and your gpg key in a convenient passphrase-encrypted file. This comes in in handy if/when your machine ever does go belly up.
More information about the original s3 script avaiable at: http://damontimm.com/code/dt-s3-backup
Latest version of the original s3 script is available at: http://github.com/thornomad/dt-s3-backup
BEFORE YOU START
This script requires user configuration. Instructions are in the file itself and should be self-explanatory. Be sure to replace all the foobar values with your real ones. Almost every value needs to be configured in someway.
You can use multiple copies of the script with different settings for different backup scenarios. It is designed to run as a cron job and will log information to a text file. Be sure to make the script executable (chmod +x) before you hit the gas.
If you don't want to modify the script directly to manage your preferences (ie: to sync it with the GIT version) you can add your settings directy into the file ~/.dt-cf-backup.conf which would get sourced by the script and override modified settings in the script.
REQUIREMENTS
- duplicity.
- python-cloudfiles
- gpg
- Rackspace Cloud Files account
COMMON USAGE EXAMPLES
-
View help: $ dt-cf-backup.sh
-
Run an incremental backup: $ dt-cf-backup.sh --backup
-
Force a one-off full backup: $ dt-cf-backup.sh --full
-
Restore your entire backup: $ dt-cf-backup.sh --restore You will be prompted for a restore directory
$ dt-cf-backup.sh --restore /home/user/restore-folder You can also provide a restore folder on the command line.
-
Restore a specific file in the backup: $ dt-cf-backup.sh --restore-file You will be prompted for a file to restore to the current directory
$ dt-cf-backup.sh --restore-file img/mom.jpg Restores the file img/mom.jpg to the current directory
$ dt-cf-backup.sh --restore-file img/mom.jpg /home/user/i-love-mom.jpg Restores the file img/mom.jpg to /home/user/i-love-mom.jpg
-
List files in the remote archive $ dt-cf-backup.sh --list-current-files
-
Verify the backup $ dt-cf-backup.sh --verify
-
Backup the script and gpg key (for safekeeping) $ dt-cf-backup.sh --backup-script
NEXT VERSION WISH LIST
- --restore-dir option
- restore files from a specific time period
Thanks to Mario Santagiuliana for his help.