1

I had a strange behavior in Ubuntu 20.04 cron job:

* * * * * echo "Hello world!" >> /tmp/hello.log 2>&1    <---working with logs
5 10 * * * echo "Hello world!" >> /tmp/hello.log 2>&1   <---doesn't working, no logs.

My another debian 11 are working fine with both time-set above.

The time/timezone, privilege are all good, any ideas?

Freeman di
  • 17
  • 5
  • 2
    Does this answer your question? [Why is my crontab not working, and how can I troubleshoot it?](https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it) - among the many debug options and common issues the missing new line after the last entry in a cron tab file that otherwise looks good is a likely candidate in your example – Bob Jan 28 '22 at 11:12

1 Answers1

0

It turns out I didn't restart cron service after I changed the timezone.

service cron restart

Solved the problem.

Freeman di
  • 17
  • 5
  • In the future, you could include details in your question, such as where you are adding the cron job. For example, I assumed you were using `crontab`. – Paul Jan 28 '22 at 13:44