0

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.

Gobs
  • 141
  • 8
  • 2
    Do you have permissions for ur user in that directory? – arjnt Jun 19 '19 at 07:55
  • 2
    In the real world, is replaced with a real username, right ? – Soren A Jun 19 '19 at 08:13
  • @Melebius I checked that thread and checked the first 4 answers and they didn't help. – Gobs Jun 19 '19 at 12:01
  • @arjithn I do, and also is replaced with a real username – Gobs Jun 19 '19 at 12:02
  • 1
    Please [edit] your question to add the command you used to edit the crontab and the output of `ls -ld /home//Desktop`. You can also try to log the output by adding `> /home//crontest.log 2>&1` at the end of your command. If the file gets created, post its contents. See also [Debugging crontab jobs](https://stackoverflow.com/questions/4883069/debugging-crontab-jobs). – Melebius Jun 19 '19 at 12:06
  • as always: USE ABSOLUTE PATHS. /usr/bin/touch – Rinzwind Jun 20 '19 at 20:15

0 Answers0