a BASH utility for scheduling serial execution of cron jobs of indeterminate length
A BASH framework for scheduling serial execution of cron jobs of indeterminate length, with support for queuing and restart flags.
- place serialcron folder in /opt or another location
- add $JOBS="/opt/serialcron" to /etc/environment
- add $LOGS="/opt/serialcron/logs" to /etc/environment
- sudo ln -s /opt/serialcron/execute.sh /usr/bin/execute
- sudo ln -s /opt/serialcron/monitor.sh /usr/bin/monitor
// #! /bin/bash // # exported script name appears in logs // export SCRIPT="sample-script"
// your code goes here
the third parameter indicates whether the script should be queued if another script is currently executing
execute sample-script execute //sample-script execute sample-script / execute sample-script /
// # cron invocation // # m h dom mon dow command // 01 * * * * execute sample-script $HOME true # queue script if a script is running // 05 * * * * execute sample-script $HOME false # cancel request if a script is running // 10 * * * * execute sample-script # optionally invoke a script with no directory param BE CAREFUL
monitor