Ubuntu system crontab works, but root crontab does not

cronUbuntu

I am having a strange problem about ubuntu crontab here.

If I add the following line to system crontab(/etc/crontab), it works well

*/1 * * * * root /bin/date >> /root/text

but if I edit root crontab by using crontab -e with root user, and add

*/1 * * * * /bin/date >> /root/text

it does not work at all.

Can you please help me on this?

Thank you

update and answer

I got my answer after searching server fault, the reason is explained in this post.

The reason is that crontab file need a newline in the end, otherwise it will not work.

Best Answer

OP found the solution:

I got my answer after searching server fault, the reason is explained in this post.

The reason is that crontab file need a newline in the end, otherwise it will not work.

Related Topic