954,249 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Cron Job

Hi Guys,
I have set up a cron job on a Centos server that is supposed to execute a script that looks for SMS messages in a queue and processes them. My crontab file is under /etc/crontab. The job is supposed to be run after every 5 minutes. The command I have added to the crontab file is 01 * * * * root /usr/local/bin/readsms.pl to make it run after every minute. However, when I look at the cron log, the job is running after every one hour. Please help me figure out whether its my command that is wrong because as I understand it the command 01 * * * * root /usr/local/bin/readsms.pl is supposed to execute the script after every one minute.

c-tech
Junior Poster
119 posts since Aug 2007
Reputation Points: 13
Solved Threads: 8
 

It appears the the zero is being read as minutes and the one as the hour. I doubt any of the cron programmers allowed for someone entering "01" instead of just "1".

woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
 

P.S The 01 was added automatically even though in the command I had put only 1 without a zero. I was able to sort it out. It seems that if you just want the job to be executed every minute, you do not have to specify the 1, you just type in the command as * * * * * /. And I think this makes sense because a minute is the least time you can specify for intervals of job executions.
Thanks for the reply woooee; nice name :) by the way.

c-tech
Junior Poster
119 posts since Aug 2007
Reputation Points: 13
Solved Threads: 8
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: