0

I have set crontab to execute a script in my home directory. This is the line:

0 * * * * ~/minds.sh # JOB_ID_1

The script itself has been placed inside /etc/cron.daily/ and it still is not executing. It has execute permissions and the ownership of the script is correct, first case the home user owns the script and in the second case root.

It is supposed to run every hour. I cant figure out what is going on and why it is not working. Any suggestions?

UPDATE:

To update I have edited the crontab and it is now 0 * * * * /home/user/minds # JOB_ID_1. I have remove the .sh extension and the scrip works. Now I just have to wait for it to see if it will work. Will report back in an hour.

UPDATE2:

The crontab and /etc/cron.daily/ are not executing at all.

  • did you check manually to execute a sh file and find is it works fine or not? – Tamil Selvan C Aug 12 '17 at 14:39
  • 2
    cron doesn't understand ~/ use an absolute path instead /home/user/... – waltinator Aug 12 '17 at 14:45
  • I have updated the question. Will report back in an hour. – Emil Zahariev Aug 12 '17 at 14:57
  • @steeldriver Nothing is executing at all. – Emil Zahariev Aug 12 '17 at 16:01
0

After a bit of reading this appears to work. Here is the relevant article:

0 * * * * export DISPLAY=:0 && /home/user/minds >log 2>&1 # JOB_ID_1

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.