0

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

Randell
  • 1,133
  • 7
  • 18
  • 25

3 Answers3

5

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

Andy
  • 5,190
  • 23
  • 34
1

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

drAlberT
  • 10,871
  • 7
  • 38
  • 52
-2

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

it will show u file coming to desktop

Rajat
  • 3,329
  • 21
  • 29