Skip to content

Instantly share code, notes, and snippets.

@yanbab
Last active December 29, 2015 20:19
Show Gist options
  • Save yanbab/7722991 to your computer and use it in GitHub Desktop.
Save yanbab/7722991 to your computer and use it in GitHub Desktop.
Gandi simple hosting daily mysql backup
# 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