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 crontabcrontab
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.