Cron job

Soldato
Joined
16 Oct 2007
Posts
7,478
Location
UK
Hello all,

I want to back up a very miniscule database hourly onto my server - it's running cPanel, and thought about doing it with a cron job.

Any tips?
 
Well, i created cron.sh

#!/bin/sh
DATE=`/bin/date +"%G%m%d"` ;
mysqldump --host=localhost --user=******_address --password=******* --database=*********** --single-transaction --quick | gzip > ./public_html/tmp/backup-$DATE.sql.gz ;


And then in the cPanel cron box, I just put the path to cron.sh
(home/******/cron.sh)

Told it to run every minute, so I could see if it did anything, but nope!
 
i wouldn't have used 'cron.sh' as the name of the script.

can you run you script manually to see if it works? If it does then maybe its' a problem with cpanel. Also often things just not working is down to permissions check them.
 
Renamed, thank you

Also a slight issue where I don't have shell access to run the script to test, although apparently the cron is still able to run it. Looking at the email report, it does seem to be a permission error. Will look further! thanks for that
 
Back
Top Bottom