vikingcode
vikingcode

Reputation: 633

Cronjob for python script not working

I have an ubuntu box I'm trying to setup a cronjob for. When I do crontab -e this is what I am using as the instructions. I need it run every 11 minutes.

0/11 * * * * python /path/to/file/foo.py

At the top of the python script I have put:

#!/usr/bin/python

And I have done:

sudo chmod a+x foo.py

I'm not really sure how I am supposed to figure out how it ran correctly. The script works fine on my local, and appends something to a text file. I have been checking the txt file and nothing appears. Any suggestions?

Upvotes: 2

Views: 153

Answers (1)

unutbu
unutbu

Reputation: 880717

The cron line

0/11 * * * * python /path/to/file/foo.py

will fire only when the minutes equals 0. To make it fire every 11 minutes use

*/11 * * * * python /path/to/file/foo.py

Upvotes: 1

Related Questions