I have a very weird problem. I have a crontab which looks like this (this is the output of crontab -l
:
* * * * * touch /home/<user>/Desktop/crontest.txt
A sample output of sudo grep CRON /var/log/syslog
gives:
Jun 19 09:49:01 set-l-me-l16039 CRON[8399]: (u0128861) CMD (touch /home/<user>/Desktop/crontest.txt)
Yet no file is created in my Desktop! Running the command in the terminal produces the text file crontab.txt but the cron job doesn't. I'm running Ubuntu 18.04.
EDIT: I use crontab -e
to edit my crontab. Also I should mention that the same happens on my other machine running Ubuntu 18.04.
ls -ld /home/<user>/Desktop
. You can also try to log the output by adding> /home/<user>/crontest.log 2>&1
at the end of your command. If the file gets created, post its contents. See also Debugging crontab jobs. – Melebius Jun 19 '19 at 12:06