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.

Recommended Answers

All 2 Replies

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".

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 * * * * * <owner> /<path to script>. 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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.