0

Hi i have created a birthday notification. My Cron URL is http://dev.raddyx.in/bday/birthday.php

I want to set cron run in every 24 hour but i am unable to run in the Linux server.

Check my command:-

50  10  *   *   *   curl -s -o /dev/null http://dev.raddyx.in/bday/birthday.php

Please help me how to set cron in Linux server?

Chinmay235
  • 3,236
  • 8
  • 62
  • 93

2 Answers2

1

Are you entering this in /etc/crontab? If so, then you will also need to specify the user that the command is to run as, in the sixth field:

50  10  *   *   *  root curl -s -o /dev/null http://dev.raddyx.in/bday/birthday.php

You may want to look in /var/log/cron for some leads on the problem.

billyw
  • 388
  • 1
  • 5
  • 15
  • I am unable to find `/var/log/cron` – Chinmay235 Dec 10 '13 at 05:34
  • @Chinmay Which Linux distribution are you running? – billyw Dec 10 '13 at 05:38
  • I don't know which distribution. Can you say me ho to know the distribution? – Chinmay235 Dec 10 '13 at 05:51
  • I usually find out with either `cat /proc/version` or `uname -a`. Also, if you're concerned about whether the cron daemon is running or not (I would be surprised if it isn't), then check if `ps aux | grep [c]rond` returns info on the process. – billyw Dec 10 '13 at 05:57
0

Check the CURL is available or not otherwise you can use wget to execute the request

This will execute every 10:50. You can try this also

50 10 * * * /usr/bin/wget -O- http://dev.raddyx.in/bday/birthday.php >> /dev/null

This will dump your errors into this cronerror.txt file

59 10 * * *  /usr/bin/wget -q /var/www/<your log folder path>/cronerror.txt http://dev.raddyx.in/bday/birthday.php
Sundar
  • 4,580
  • 6
  • 35
  • 61
  • This working for me in past two years. May be your wget installation path is in different place for more refernce http://linux.about.com/od/commands/l/blcmdl1_wget.htm – Sundar Dec 10 '13 at 05:49
  • http://linux.about.com/od/commands/l/blcmdl1_wget.htm use only wget instead of /usr/bin/wget use like 50 10 * * * wget error_path httppath – Sundar Dec 10 '13 at 05:50
  • how to know wget installation path? – Chinmay235 Dec 10 '13 at 05:58
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/42833/discussion-between-chinmay-and-sundar) – Chinmay235 Dec 10 '13 at 06:00