Last active
December 29, 2015 20:19
-
-
Save yanbab/7722991 to your computer and use it in GitHub Desktop.
Gandi simple hosting daily mysql backup
This file contains 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
# Sample anacrontab usage on Gandi Simple hosting | |
# | |
# Does a daily mysql backup and delete 1 week old backups | |
# | |
# SFTP : lamp0/etc/cron/anacron/anacrontab | |
# SSH : /srv/data/etc/cron/anacron/anacrontab | |
@daily 0 mysql_backup mkdir /srv/data/tmp/mysql_backup ; mysqldump -h localhost -u root {-pPASSWORD} --all-databases > /srv/data/tmp/mysql_backup/`date '+%F'`.databases.sql ; rm /srv/data/tmp/mysql_backup/`date '+%F' --date '1 weeks ago'`.databases.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment