Skip to content

Instantly share code, notes, and snippets.

@qwazix
Created August 19, 2015 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwazix/6f49edd7b3ebc6e75d4f to your computer and use it in GitHub Desktop.
Save qwazix/6f49edd7b3ebc6e75d4f to your computer and use it in GitHub Desktop.
Backup your owncloud instance to Amazon Glacier
#!/bin/bash
#install glacier-cmd
#set up your ~./glacier-cmd file
#run this in a cron job
name=/home/user/backups/c.d-e.gr_$(date '+%y-%m-%d').tar.gz
mysqldump --lock-tables -h localhost -u dbuser -pdbpass, dbname > /home/owncloud/dbbackup/owncloud-sqlbkp.bak
tar czvf "$name" /home/owncloud
glacier-cmd upload c.d-e.gr $name
rm $name
echo "Backed up $name" >> ~/backuplog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment