CPanel Cron Jobs

Associate
Joined
16 May 2005
Posts
680
I'm trying to use cron job to call a php file to backup and email a MySQL DB, but it doesn't seem to be doing anything? It's given me the option to add in my email address to send the results to but nothing is coming through?

I've done it 5 minutes, every minute, nada...
 
S'alright, it appears it won't email to anywhere other than @domainname, I get an error in the root mailbox that it can't route to my test address.
 
Right got everything working, just wondered about date/times.

I'm using

Code:
date=`date -I` ; mysqldump --opt -Q -u username --password=password database > /home/username/public_html/backups/backup_$date.sql ; gzip /home/username/public_html/backups/backup_$date.sql

Now date -I gives me Y-m-d, date on it's own gives a full GMT with spaces, I was wondering about formatting?
 
Oh yeah it's doing everything fine, the zipping isn't quite working at the minute but the sql file is being written ok, I just wanted to know about how to format the date and time.

date -I is fine for this, but if I wanted something to backup on a more regular basis for whatever reason I wanted to be able to set different file names using the date and time
 
Back
Top Bottom