Last active
September 10, 2018 13:09
-
-
Save lucien144/5dd948ad65924f940bc0f557c1071485 to your computer and use it in GitHub Desktop.
MySQL backup using s3cmd & automysqlbackup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get install automysqlbackup | |
apt-get install s3cmd | |
s3cmd --configure | |
s3cmd sync --recursive --delete-removed /var/lib/automysqlbackup/ s3://bucket/mysql/ | |
s3cmd sync --exclude-from=/root/s3cmd.exclude --recursive --delete-removed /sites s3://bucket/sites/daily/`echo $(date +"%F")`/ | |
find /var/lib/automysqlbackup/ -name *.sql.gz -mtime +7 -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment