21
votes

It might be very simple question, but how could I run a python script on my fedora dist every 2 days?

Thanks

Antonis

1
What part of cron confuses you? Creating the schedule? Or running a Python script? What part of the cron man pages have you read? What have you tried? What errors are you getting? Can you be more specific on what help you need? - S.Lott
S.Lott, I think he wanted a quick solution. Not sure, if these kind of questions should be encouraged. - Senthil Kumaran
Thank you anyway. I just needed a quick solution. I know should read the man pages and try different things. You are right - Antonis
@S.Lott to his problem, - 'How to do this task' kind? - Senthil Kumaran

1 Answers

66
votes

It is a question on cron. First is add a SHEBANG line on top of your python script.

#!/usr/bin/env python

Make your script executable with chmod +x

And do a crontab -e and add 0 0 */2 * * /path/to/your/pythonscript.py