thesebas / runlock
Installs: 946
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
pkg:composer/thesebas/runlock
Requires
- mongodb/mongodb: ^1.0.2
 - ulrichsg/getopt-php: ^2.3
 
Requires (Dev)
- phpunit/phpunit: ^5.2.10
 
This package is auto-updated.
Last update: 2025-10-25 12:35:29 UTC
README
Help
runlock <options>
    acquire/free lock
    exit codes:
    0 - lock acquired
    1 - failed acquiring lock
    2 - other error
Options:
  -a, --action <arg>      `lock`, `unlock` or `reset` [default: `lock`]
  -l, --lockname <arg>    lock name
  -n, --count <arg>       how many locks can be acquired [default: 1]
  -d, --delay <arg>       delay running script rand(0, n) seconds
  -c, --config <arg>      path to file with params in .ini format [default: /etc/runlock/config.ini]
  -v, --verbose           verbose mode
  -h, --help              show help
How to install
composer global require thesebas/runlock:dev-master
How to use
In crontab
*/15 * * * * runlock -l lockname && (job_to_do.sh || runlock -a unlock -l lockname)