An open API service indexing awesome lists of open source software.

https://github.com/thesebas/runlock


https://github.com/thesebas/runlock

Last synced: 21 days ago
JSON representation

Awesome Lists containing this project

README

          

# runlock

## Help
```
runlock
acquire/free lock

exit codes:
0 - lock acquired
1 - failed acquiring lock
2 - other error

Options:
-a, --action `lock`, `unlock` or `reset` [default: `lock`]
-l, --lockname lock name
-n, --count how many locks can be acquired [default: 1]
-d, --delay delay running script rand(0, n) seconds
-c, --config path to file with params in .ini format [default: /etc/runlock/config.ini]
-v, --verbose verbose mode
-h, --help show help
```

## How to install
```bash
composer global require thesebas/runlock:dev-master
```

## How to use

In `crontab`

```crontab
*/15 * * * * runlock -l lockname && (job_to_do.sh || runlock -a unlock -l lockname)
```