Como Michael Kjörling sugeriu nos comentários, você deve ser capaz de fazer isso com um simples script bash. Algo parecido com isto:
#!/usr/bin/env bash
## Log file to which the "echo" commands bellow will write
logfile="/tmp/$$.log"
## Change "ls /etc >/dev/null " to reflect the actual
## jobs you want to run but keep the "&& echo job N finished" as is.
jobA="ls /etc >/dev/null"
jobB="ls /etc >/dev/null && echo 'job B finished' >> $logfile"
jobC="ls /etc >/dev/null && echo 'job C finished' >> $logfile"
jobD="ls /etc >/dev/null && echo 'job D finished' >> $logfile"
jobE="ls /etc >/dev/null";
## Run job A, launch jobs B and C as soon as A is finished
## and launch job D 30 minutes after A finishes.
eval $jobA && (sleep 30 && eval $jobD) & eval $jobB & eval $jobC &
## Now, monitor the logfile and run job E when the rest have finished
while true; do
lines='wc -l $logfile | cut -f 1 -d ' '';
echo "$logfile : $lines"
## The logfile will contain 4 lines if all jobs have finished
if [ "$lines" -eq 3 ];
then
## Run job E
eval $jobE
## Delete the logfile
rm $logfile
## exit the script
exit 0;
fi
## Only check if the jobs are finished once a minute
sleep 60;
done
Se você usar cron
para iniciar este script às 00:05, ele deverá fazer o que quiser. O principal truque aqui é o uso de subshels ()
and% código%. Os subshels permitem que você execute vários trabalhos em segundo plano e &&
para executar apenas trabalhos depois que outro trabalho tiver saído com êxito.