Skip to content

Instantly share code, notes, and snippets.

@robraux
Created March 21, 2012 02:00
Show Gist options
  • Save robraux/2143639 to your computer and use it in GitHub Desktop.
Save robraux/2143639 to your computer and use it in GitHub Desktop.
Example of using Duplicity in Ubuntu
#1 Install it (example of linking to RackSpace Cloud), ubuntu example
apt-get install duplicity
apt-get install python-setuptools
git clone git://github.com/rackspace/python-cloudfiles.git
python setup.py install
#2 Create a simple shell script (put this in a shell script)
export CLOUDFILES_USERNAME=YOURNAME
export CLOUDFILES_APIKEY=YOURKEY
# no encryption, 100mb file, retry volume sync 5 times just in case of timeouts (it's the cloud after all)
duplicity --no-encryption --volsize 100 --num-retries=5 /var/www/dir cf+http://bucket_name
# cron it up (example runs at 10:02 am and 11:02 pm
root@domU-12-51-39-10-2C-91:~/backup/scripts/production# crontab -l
# m h dom mon dow command
2 10,23 * * * cd /root/backup/scripts/production && zsh master.sh
#3 Make sure it's working damn it!
duplicity collection-status cf+http://bucket_name
# or list files...
duplicity list-current-file cf+http://bucket_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment