Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
734 views
in Technique[技术] by (71.8m points)

running a python script with cron

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

Thanks

Antonis

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...