The date command gives you a date string which you can use in file naming. Like in:
Code:
fname=myfile_$(date +%F)
which produces a file name myfile_2008-04-21.
You can use the mysqldump command to make a dump from the database. See the man page for the numerous options mysqldump provides.
All other commands can be issued from the command line or a Bash script in the form:
Code:
echo "SQL statement" | mysql -u username -ppasswd databasename
I recommend to put all commands in a Bash script, and call the Bash script as a cron job. Be sure to include full paths for everything you call or use in the file, cron jobs run in a different environment than your command line.
jlinkels