I have such bash script:
array=( '2015-01-01', '2015-01-02' )
for i in "${array[@]}"
do
python /home/user/executeJobs.py {i} &> /home/user/${i}.log
done
Now I want to loop through a range of dates, e.g. 2015-01-01 until 2015-01-31.
How to achieve in Bash?
Update:
Nice-to-have: No job should be started before a previous run has completed. In this case, when executeJobs.py is completed bash prompt $
will return.
e.g. could I incorporate wait%1
in my loop?
datetime
Python module.wait
(as in, bugs happening due to concurrent processes when you don't), then you have something more interesting / more complicated going on, which needs a more complicated solution (like asking the subprocess to inherit a lockfile), which is enough complexity and sufficiently unrelated to date arithmetic that it should be a separate question.