Skip to content

Instantly share code, notes, and snippets.

Created December 6, 2008 13:02
What would you like to do?
backup cron (backups of last 7 days, last month or any year)
# place this file in the directory you want to keep the backup
# mysqldumps. this script lets you retrieve dumps of last 7 days,
# last month or any year
cd `dirname $0`
mysqldump $BACKUP_DB -u root > today.sql && \
gzip -f today.sql && \
cp today.sql.gz "`date +'%G'`".sql.gz && \
cp today.sql.gz "`date +'%b'`".sql.gz && \
cp today.sql.gz "`date +'%a'`".sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment