0

On a google Cloud Ubuntu VM, I have setup few crontab like below :

0 15 * * * sudo /home/username/bin/python /home/username/project27/scheduler/batch.py   &>> /home/username/project27/scheduler/log_batch.txt 


1) Crontab worked if I remain login in SSH session.
2) As soon as I close the SSH session the crontab job is not launched.

What's wrong with this ?

How to find the issue ?

  • encrypted home? + the concerns stated in the answer bellow ... – Jakuje Jul 4 '17 at 13:54
  • Looked in /var/log/cron ? – user59328 Jul 4 '17 at 15:02
  • yes, looked in cron log – quantCode Jul 5 '17 at 0:41
-1
  • In /etc/crontab used in Ubuntu, the 6th item is an id used to run the command, so it should be root (or project27) instead of sudo.
  • /home/bin/python? Really?
| improve this answer | |
  • 1
    updated the paths.... – quantCode Jul 4 '17 at 14:31
  • /home/username/bin/python still doesn't look like a valid place for a python interpreter... And you confirm the sudo? – xenoid Jul 4 '17 at 15:46

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.