rnish
rnish

Reputation: 165

Scheduling Python Script - Linux

I am trying to run a couple of experiments which take anywhere between 4-6 hours.

I am running these experiments using python. Is there way for me to automate so that I can run the experiments one after the other?

I looked at the at function in python. that only allows me to schedule it at a particular time. However, I don't know at what time the experiment ends.

could you suggest a function that I can use for scheduling or even how to automate using a shell script? or an example

Upvotes: 0

Views: 394

Answers (1)

paxdiablo
paxdiablo

Reputation: 881453

Well, you could do the easy approach and just batch them up in a shell script:

#!/bin/bash

date
python stage1.py ; date
python stage2.py ; date
python stage3.py ; date
python stage4.py ; date
python stage5.py ; date
python stage6.py ; date

Then either schedule, or just run, the script itself. That seems to be the easiest solution.

The calls to date are simply there so you can see how long each stage took. They may or may not be necessary, or they can be replaced with a different timing solution.

Upvotes: 3

Related Questions