Results 1 to 3 of 3
I've created a crontab to run a php script (daemon) at boot.
crontab -l:
Code:
(at)reboot /usr/bin/php-cgi /var/backbone/fork_sema.php 2>&1 > /dev/null
(at)reboot export EDITOR="vi"
When I run the command as ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-28-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 4
[SOLVED] Crontab not working
I've created a crontab to run a php script (daemon) at boot.
crontab -l:
When I run the command as root it works. I've added "#!/usr/bin/php-cgi -q" to the beginning of the file. I've also tried to putting "root" before the command, which I've now removed. The command is executed at boot, but the script is not running.Code:(at)reboot /usr/bin/php-cgi /var/backbone/fork_sema.php 2>&1 > /dev/null (at)reboot export EDITOR="vi"
The second command doesn't work either.
Any suggestions? Thanks..
- 12-29-2009 #2Which distro are you using? Are you trying at command? .Check this link.(at)reboot export EDITOR="vi"
A quick and simple guide to crontab usage - crontabrocks.org
for crontab examplesFirst they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-----
FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org
- 12-29-2009 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 4
Problem found.
Apparently cron runs before mysql. My php script quits because it is unable to connect to the db.
Fix: Put a sleep before connection attempt.
I also was able to make the default editor change permanent by editing ".bash_aliases".
Thanks-



