Mysql hourly backup using cron
I wanted a cron job to run that would backup my Mysql database each hour. But I also wanted the command to create a new file each time preserving the history.
This is the command I came up with:
mysqldump --opt -u [username] [dbname] > /path/to/backups/database-`date +%Y-%m-%d-%k:%M:%S`.sql