Need help setting up cron. Script works fine in ssh.

Beamar

Verified User
Joined
Dec 27, 2012
Messages
11
I have a backup script I made. It works prefect in ssh.

But when I try to run it as a cron, I get the following error:

Code:
Error: MYSQL not found

This is the code in the script:

Code:
#!/bin/sh

MYSQL="$(which mysql)"
if [ -z "$MYSQL" ]; then
    echo "Error: MYSQL not found"
    exit 1
fi


and I have tried 2 different cron commands:


/home/username/script.sh
and also
/bin/sh /home/username/script.sh


any ideas?


thanks,
Brian
 
Did you install the cron as root with crontab-e ?
or as a user in the DA panel ?
 
user in DA panel



Side-note: is there a way to turn off these "Random Questions".
 
customer

This is on a shared server and I do not have root access.


Brian
 
Well should be 755 actually... but should worka swell at 777 (depend on server settings) and is less secure.
Have you tryed contact your hosting provider?

Regards
 
Back
Top