https://github.com/thesebas/runlock
https://github.com/thesebas/runlock
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/thesebas/runlock
- Owner: thesebas
- Created: 2016-09-21T06:36:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-28T09:25:13.000Z (over 8 years ago)
- Last Synced: 2025-12-14T11:20:01.039Z (6 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)
```