Planning Python Scripts on Linux

I was looking for time for a better way to do this, but not really very far. I have a python script that runs several times a day in cron, this script defines the time and dates that another script should be scheduled. The time, date, and duration this script should run vary greatly, and these are one-time events.

My problem is how to actually plan these events. Can anyone advise a suitable python or linux method?

thanks

UPDATE: Thanks for the invitation.

For anyone looking for this, this is what I did for the foobar.py script to run at 9.15am on July 14th:

import subprocess subprocess.Popen(['python foobar.py | at 9.15am Jul 14',], shell=True) 
+4
source share
2 answers

Use the at command from a python script. See the documentation here .

+3
source
 import time,sched; 

I think the schedule is what you are looking for

0
source

Source: https://habr.com/ru/post/1412431/


All Articles