cronlocker

command module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2023 License: MIT Imports: 11 Imported by: 0

README

cronlocker

GitHub Build Status GitHub go.mod Go version GitHub release (latest by date)

cronlocker is a commandline tool to allow running cronjobs on multiple hosts while ensuring that it only runs once at a time. cronlocker utilizes the consul lock feature to ensure that.

Usage

cronlocker can be easily executed by passing a key to lock as well as a command to be executed if the lock could be obtained successfully.

cronlocker -key=<key/to/lock> <command>

Use cronlocker --help to get the following output:

Usage of ./cronlocker:
  -endpoint string
      endpoint (default "http://localhost:8500")
  -failwithoutlock
      Exists with status code 1 if the lock was not received within lockwaittime
  -key string
      key to monitor, e.g. cronjobs/any_service/cron_name (default "none")
  -lockwaittime int
      Configures the wait time for a lock in milliseconds (default 500)
  -maxexecutiontime int
      Configures the maximum time in milliseconds the execution of the given command can take
  -minlocktime int
      Configures the minimum time in milliseconds a lock is held (default 5000)
  -token string
      consul authentication token. leave blank if none applicable

Packaging

Execute make package to package the application as a debian package.

Note: fpm is required

Bugs and Contribution

For bugs and feature requests open an issue on Github. For code contributions fork the repo, make your changes and create a pull request.

License

LICENSE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL