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*/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!