Crontab does not launch when log out

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 ?

quantCode

Posted 2017-07-04T13:22:46.377

Reputation: 11

encrypted home? + the concerns stated in the answer bellow ... – Jakuje – 2017-07-04T13:54:16.690

Looked in /var/log/cron ? – barrycarter – 2017-07-04T15:02:40.683

yes, looked in cron log – quantCode – 2017-07-05T00:41:13.883

Answers

-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?

xenoid

Posted 2017-07-04T13:22:46.377

Reputation: 7 552

1updated the paths.... – quantCode – 2017-07-04T14:31:37.610

/home/username/bin/python still doesn't look like a valid place for a python interpreter... And you confirm the sudo? – xenoid – 2017-07-04T15:46:38.827