Gossamer Forum
Home : General : Internet Technologies :

cron problem

Quote Reply
cron problem
Hi there

This redhat/linux server running apache when I run the command below in shell command prompt it would work but however when run as cron it would just say mysqldump not found.

For instance the command below for backing up one our our database:

mysqldump --opt -u foo -pfoo database > database.sql

when executed from shell prompt will work just fine, but try and run this as cron and it would say that there is no such command or cannot find mysqldump.

The shell script for the cron above that would NOT work would be:

#!/bin/sh
mysqldump --opt -u foo -pfoo database > database.sql

The shell script for the cron above that WOULD work would be:

#!/bin/sh
/home/mysql-3.23.56/bin/mysqldump --opt -u foo -pfoo database > database.sql

Does anyone have any idea? I wrote to my server ppl but they yet to reply, they hardly help anyways.... grrrr

thanks a lot.
Quote Reply
Re: [roi8877] cron problem In reply to
mysqldump is not in your $PATH. You'll have to specify the full path to mysqldump like you've done in your last script to get it to work in crontab.

Adrian
Quote Reply
Re: [brewt] cron problem In reply to
HI there,

Thank you for your reply.

Does anyone know than how I would confiure my username so that such things like mysqldump and php paths, etc are present in my path?

Thank you very much.