Reputation: 45
I can keep a Python script running all the time with a specific delay time but that looks too silly as it keeps on using the system that too being idle so whats the solution?
Upvotes: 1
Views: 142
Reputation: 8608
Use cron
. On command line it's crontab -e
to open a vim editor where you can schedule things to run. Here's the documentation. So to run a script every minute ever with cron you would add this line to your crontab:
* * * * * python <path to>/script.py
First * is every minute, but could eg be a number between 0 and 59 to run once an hour, second * codes for hour of day, third is day of month and so on.
Upvotes: 2