Skip to main content
2 of 3
added 155 characters in body
LA_
  • 404
  • 2
  • 8
  • 17

How to check if cron job works?

I use crontab -e without sudo to edit cron jobs and add the following line there -

20 22 23 10 * date "+%Y-%m-%d %H:%M:%S" >> ~/Documents/log.txt

then I check the log file and it doesn't contain the date and time.

I tried to edit crontab as root, but it also doesn't update the file. What could be wrong here? Is there any way to see the log of cron jobs execution?

P.S. Update crontab created under root:

0/5 * * * * /bin/date "+%Y-%m-%d %H:%M:%S" >> /tmp/log.txt
0/5 * * * * echo >> /tmp/log2.txt

log2.txt is created now.

LA_
  • 404
  • 2
  • 8
  • 17