Last active
December 17, 2015 12:58
-
-
Save jedgalbraith/5613280 to your computer and use it in GitHub Desktop.
pagoda cron commands for regular MySQL backups
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
# 'backups/' dir must exist previously. | |
# Removes backup files older than 7 days, | |
Command: find backups/* -mtime +7 -exec rm {} \; | |
# Every day at midnight | |
UNIX cron schedule: 0 0 * * * | |
# Creates backups in the 'backups/' writable directory. | |
Command: mysqldump -h $DB1_HOST -P $DB1_PORT -u $DB1_USER -p$DB1_PASS $DB1_NAME > backups/$DB1_NAME-"$(date +"%m_%d_%Y")".sql | |
# Every day at 1AM | |
UNIX cron schedule: 0 1 * * * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment