Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

What's the simplest test that I can do to check if my cron jobs are working?

share|improve this question

marked as duplicate by Ladadadada, growse, Michael Hampton, mdpc, Falcon Momot May 19 '13 at 17:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Do you want a simple or reliable check? – Jan Jungnickel Sep 1 '09 at 10:40
    
Simple check will do, like Andy's answer. A more complicated check might also prove useful in the future. – Randell Sep 1 '09 at 10:51
up vote 5 down vote accepted

Set up a test cron:

*/5 * * * * echo "test" > /tmp/crontest.txt

This will write "test" to the file /tmp/crontest.txt every 5 minutes

Ensure the cron daemon crond is running using

[andy@server]# ps aux | grep cron

root 4321 0.0 0.0 76543 3211 ? Ss Jul31 0:07 crond

Check the logs using

tail /var/log/cron

Try date to ensure you are in the correct timezone

share|improve this answer
    
I had to make the first parameter to 0-59/5 to make it work. – Randell Sep 1 '09 at 10:34
    
Apologies it should have read */5, have amended answer – Andy Sep 1 '09 at 10:47

Simply change their execution time and see the result ! :)

If you have cron that will run on

12 24 * * *

change it to

mm hh * * *

where hh and mm is an hour and minute very near to the actual time.

Once verified the execution restore the correct timing

share|improve this answer
    
+1 for tip on changing the execution time – Randell Sep 1 '09 at 10:49

/2**** touch cronrunning >/root/Desktop

it will show u file coming to desktop

share|improve this answer
3  
Downvoted: Bad practice, invalid syntax, bad spelling. – Jan Jungnickel Sep 1 '09 at 10:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.