lockrun

Prevents concurrent execution of cron jobs with mutual exclusion

brewmacoslinux
Try with needOr install directly
Source

About

Run cron jobs with overrun protection

Commands

lockrun

Examples

Run a backup script with lock protection to prevent overlapping executions$ lockrun -l /var/lock/backup.lock /usr/local/bin/backup.sh
Execute a database maintenance task with a 5-minute timeout on the lock$ lockrun -l /var/lock/dbmaint.lock -t 300 /usr/local/bin/maint.sh
Run a job and log lock contention, waiting up to 10 minutes for the lock$ lockrun -l /var/lock/job.lock -w 600 -v /usr/local/bin/myjob.sh