Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bajanReece/72123a4b59b5abda9e5d to your computer and use it in GitHub Desktop.
Save bajanReece/72123a4b59b5abda9e5d to your computer and use it in GitHub Desktop.
Cron task to do a mysqldump and then name the output as the day (number) of the week
10 23 * * * /usr/local/mysql/bin/mysqldump --add-drop-table -u My_User_Name -pSuperDuperPassword myAwesomDB > "/path/to/database_backups/myAwesomDB_"`date +\%u`.sql
@bajanReece
Copy link
Author

See the man page for date for other options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment