Skip to main content
Tweeted twitter.com/askdifferent/status/790922475399966720
added 2 characters in body
Source Link
Allan
  • 104.4k
  • 33
  • 206
  • 470

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.

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.

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.

added 155 characters in body
Source Link
LA_
  • 404
  • 2
  • 8
  • 17

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.

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?

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.

Source Link
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?