Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a cronjob similar to this:

*/1 * * * * /usr/bin/python /home/root/test.py >> /home/root/spring.1

In test.py, I am just printing the current time. After few mins of observation, I see this in spring.1 log file:


17/12/2009 10:09:01 AM


17/12/2009 10:09:01 AM


17/12/2009 10:09:01 AM


17/12/2009 10:09:01 AM


17/12/2009 10:09:01 AM


17/12/2009 10:10:01 AM


17/12/2009 10:10:01 AM


17/12/2009 10:10:01 AM


17/12/2009 10:10:01 AM

Anyone know what the problem may be? The python script is simply outputting the current time so we can say for sure that its cronjob which is opening the python multiple times.

Thanks.

share|improve this question
    
This really belongs on Serverfault, and will probably be moved soon. In the meantime, have you checked if you have multiple cron daemons running? –  derobert Dec 17 '09 at 16:36
    
I'm wondering why you'd use */1? Are you actually trying to say 01 * * * *? I'm actually curious, as I've not seen that notation before unless using some other divisor like /2 or /5.... –  Greeblesnort Dec 18 '09 at 4:22
add comment

migrated from stackoverflow.com Dec 17 '09 at 23:01

This question came from our site for professional and enthusiast programmers.

3 Answers

There was such a question here: the problem was in several cron instances running at once :)

share|improve this answer
add comment

Have you tried crontab -l? It might seem obvious but you might have the same script added several times. That's all I can think of.

http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+1

share|improve this answer
    
yes, checked that. it only shows up once like it should. –  zaid Dec 17 '09 at 16:43
add comment

thanks guys. rebooting the box fixed it. still not sure what the problem was but i think it may be that due to the number of edits i'd done to the cron configs, there were multiple instances of cron running.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.