Create a file called
daily.sh
#!/bin/sh
cd /home/username
rm mybackup.sql
mysqldump --opt -p{DBpassword} -u {DBusername} -B {databaseName} > mybackup.sql
cat msg.txt | /usr/lib/sendmail -t
Create another file called msg.txt
From: [email protected]
To: [email protected], [email protected]
Subject: Daily Backup Routine
Begin your message here. It is very important to leave a blank line before you start the body of your message.
The Backup Routine has been executed
Place them both above your public_html directory - in your user directory.
You then need to use Control Panel to setup a cron job with these paremeters.... Feel free to change them, but they work out to be 2am everyday

when its less busy.
Minute: 0
Hour: 2
Day: *
Month: *
Weekday: *
So it looks like this...........
0 2 * * * {username} /home/username/daily.sh
I havent tested this, but will do over the next couple of days.
I hope it helps - but please check with your host before using this script, as messing with Cron Jobs can cause the server to go dizzy

(if you(or I)get it wrong!)
Oh, you obviously have to change the username/dbnames in the scripts and also take out the curly brackets

And CHMOD the bash script to 755.
Good luck
Tony,