Page 1 of 1

CRONTAB, ack!

Posted: Thu Dec 12, 2002 3:55 pm
by JPlush76
Hey there..
I'm trying to install a cronjob to backup my mysql database. I created a shell script that looks like this

Code: Select all

#!/bin/sh

mysqldump -uroot -pPassword --opt DB1 > /home/jim/back.sql

rm /home/jim/testfile

exit 0
I chmod the file to make it executable then I crontab -e and put in
*/2 * * * * /home/jim/jimsql

and save it, it says crontab installed. Basically I'm looking to test it so I set it for every 2 minutes to run. I set up a testfile in the directory just so I know if its gone every two minutes my cron is working.

Well the RM command works in this file but the MySql backup does not. However when I call it from the command line ./jimsql

Boommmm, the file is there and everything works great. Any thoughts as to why this wouldn't work running as a crontab? :(
thanks all!

Posted: Thu Dec 12, 2002 4:03 pm
by JPlush76
ahh nevermind, I have to use the FULL path to the mysqldump

/usr/local/bin/myqldump


works now :)