In the home directory make a .my.cnf file
touch ~/.my.cnf
Ensure it has your login details.
[mysqldump]
user=yourdbusername
password=yourdbpassword
Permissions of the .my.cnf must be 600.
chmod 600 .my.cnf
Make script to run this. Or put it in cron as you wish.
mysqldump -u yourdbusername yourdbname | gzip > yourdbname_db_backup_`date +%Y-%m-%d`_.sql.gz
If you use cron you will want another script to rsync or SCP the backups off site. You may also want to delete some after backed up to free up space with some scheme in mind as to not run out of disk space.
Ah with modern (non macosx?) you can get ISO standard date using
date -I
Note: If you want to monitor progress bar of pipe.
pv is an awesome utility.