View Full Version : Problen in Cron job
Nirbhay
09-29-2009, 09:09 AM
Hi All,
I am currently working on cron job it is not working properly.My requirement is that the script should run in every 30 min every day. for that I have written
30 * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php
it is not calling the script but when I am writing it like
* * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php then it is calling it every min.
can any one help me.Is there anything wrong in the way I am calling the script.
abduraooft
09-29-2009, 10:44 AM
Try changing 30 * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php to
*/30 * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php
Nirbhay
09-29-2009, 11:33 AM
Thanks for the response but still it is not working properly . :(
Fou-Lu
09-29-2009, 02:20 PM
0,30 * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php
Moving from PHP to Apache configurations
btw, the */30 should have worked.
clunk.werclick
09-29-2009, 02:44 PM
--dump dump the first file to stdout and exit
By any chance are you expecting the output to appear on screen? If so, it won't happen like this as the crontab has no idea what your screen is. You can try outputting to a virtual terminal like /dev/tty1 but if this will work I can't say.
You can prove the crontab works by dumping the output into a text file instead:
0,30 * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php >> /home/whatever/lynxtest.output
You can tail it - if that helps:
(tail -f /home/whatever/lynxtest.output)
Nirbhay
09-30-2009, 07:59 AM
I am not expecting any output instead I am sending mail through the scripts.
for checking purpose I tried out with all *s and it was working fine means I was getting mails in each minute but after dividing the * by any number say 30 it is not calling the script as it seems because I am not getting any mail.
Nirbhay
09-30-2009, 08:00 AM
I am not expecting any output instead I am sending mail through the scripts.
for checking purpose I tried out with all *s and it was working fine means I was getting mails in each minute but after dividing the * by any number say 30 it is not calling the script as it seems because I am not getting any mail.[/QUOTE]
clunk.werclick
09-30-2009, 08:51 AM
So:
* * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php
Works
but
*/30 * * * * /usr/bin/lynx --dump http://localhost/TestDir/cron_test.php
Does not
Is that correct?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.