Hi,
I'm struggling to get crontab to run shell scripts. I'm running the csh shell. I've tried both shebangs, csh and sh in my script.
In /root/restart_mysqld.sh:
And my
So I'm expecting cron to re-start mysqld every five minutes. It doesn't, it fails to execute. I've checked:
and
Although I'm running cron as root so it shouldn't be a problem. If I run the script directly from the shell:
...the script works fine, everything is back to normal, mysqld restarted, websites up and running. What am I doing wrong?
I'm struggling to get crontab to run shell scripts. I'm running the csh shell. I've tried both shebangs, csh and sh in my script.
# cdIn /root/restart_mysqld.sh:
Code:
#!/bin/sh
/usr/local/etc/rc.d/mysql-server restart
And my
crontab -e:
Code:
5 * * * * sh /root/restart_mysqld.sh
So I'm expecting cron to re-start mysqld every five minutes. It doesn't, it fails to execute. I've checked:
# cat /etc/cron.allow
Code:
cat: /etc/cron.allow: No such file or directory
# cat /etc/cron.deny
Code:
cat: /etc/cron.deny: No such file or directory
Although I'm running cron as root so it shouldn't be a problem. If I run the script directly from the shell:
# sh restart_mysqld.sh
Code:
mysql not running? (check /var/db/mysql/my.domain.net.pid).
Starting mysql.
...the script works fine, everything is back to normal, mysqld restarted, websites up and running. What am I doing wrong?