LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash says "no such file or directory" when crontab runs the shell script (https://www.linuxquestions.org/questions/linux-newbie-8/bash-says-no-such-file-or-directory-when-crontab-runs-the-shell-script-935780/)

chrism01 03-22-2012 11:39 PM

In that case, we've proved there's nothing wrong with cron :)

So, use
Code:

which mysqldump

# gives on my system
/usr/bin/mysqldump

So (replacing the 'echo' cmds) your backup script would look like
Code:

#!/bin/bash
/usr/bin/mysqldump -u dbuser -pdbpass dbname > /tmp/dbname_backup.sql 2>&1

on my system, should give either the backup or the error msg into that file :)

ymnoor21 03-23-2012 11:18 AM

Quote:

Originally Posted by chrism01 (Post 4634147)
In that case, we've proved there's nothing wrong with cron :)

So, use
Code:

which mysqldump

# gives on my system
/usr/bin/mysqldump

So (replacing the 'echo' cmds) your backup script would look like
Code:

#!/bin/bash
/usr/bin/mysqldump -u dbuser -pdbpass dbname > /tmp/dbname_backup.sql 2>&1

on my system, should give either the backup or the error msg into that file :)

Excellent, finally the backups are getting created via cronjob. Thanks Chris!!! Its been tough days for me.

Thanks
Yamin


All times are GMT -5. The time now is 06:52 AM.