So I THINK the prob is most likely path. But I am confused on how to correctly set this.
So the top of my script looks like:
#!/bin/sh
MYSQL="$(which mysql)"
if [ -z "$MYSQL" ]; then
echo "Error: MYSQL not found"
exit 1
fi
when I run the script in ssh, it works prefect! But when I setup the cron, using these commands in directadmin:
/home/username/script.sh
also tried:
/bin/sh /home/username/script.sh
Both of them give me the following error:
Error: MYSQL not found
So here is what I found online:
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
I assume I need to add at least one of the above statements in my script. The server is a freebsd server and I assume everything is in the default location. I know when I do a whereis sh it returns /bin/sh
I have no idea how to check PATH or home. I'm new to freebsd so any help would be great.