thesebas/runlock

Installs: 941

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:project

1.1.0 2017-09-28 09:24 UTC

This package is auto-updated.

Last update: 2024-03-25 09:13:28 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)