Something like (call this file backup.sh):
Code:
#!/bin/bash
#Get current date
TODAY=$(date +%Y%m%d)
mysqldump --all-databases -u <YOURUSERNAMEHERE> --password=<YOURPWDHERE> -r /path/to/backup/directory/mysql-backup_$TODAY.sql
exit 0
And then enter a cron entry like:
Code:
00 1 * * * <YOURSYSTEMUSERNAMEHERE> /path/to/backup.sh
To run the script at 1am, everyday.