0

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

Randell
  • 1,173
  • 8
  • 18
  • 26

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,230
  • 1
  • 24
  • 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,949
  • 7
  • 39
  • 52
-2

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

it will show u file coming to desktop

Rajat
  • 3,349
  • 22
  • 29