Backup file to DigitalOcean. Supports rotating backups by default. Has the ability to compress a list of directories.
- Clone this repo
- Install pip
- Install requirements:
python -m pip install -r requirements.txt
- Add your S3 keys to the following named environment variables:
- SPACES_KEY:
export SPACES_KEY=yourkey
- SPACES_SECRET:
export SPACES_SECRET=yoursecret
- SPACES_REGION_NAME:
export SPACES_REGION_NAME=yourregionname
- SPACES_ENDPOINT_URL:
export SPACES_ENDPOINT_URL=yourendpointurl
- SPACES_KEY:
python dobackup.py -h
SHELL=/bin/bash
0 0 * * 1 source /home/username/.dobackup_env && /opt/digitalocean-spaces-backup/dobackup.py -o 5 --basedir /some/base/directory/to/backup space-name zip_name.zip specific/directory importantDir1 importantDir2
30 0 * * * mysqldump databasename | gzip -c > databasename.sql.gz && source /home/username/.dobackup_env && /opt/digitalocean-spaces-backup/dobackup.py -o 30 space-name database.sql.gz
See example.env