This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
116 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
releases | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: go | ||
go: | ||
- 1.6.4 | ||
- 1.7.4 | ||
- tip | ||
os: | ||
- linux | ||
- osx | ||
matrix: | ||
allow_failures: | ||
- go: tip | ||
fast_finish: true |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# :floppy_disk: runat | ||
|
||
[](https://godoc.org/qvl.io/runat) | ||
[](https://travis-ci.org/qvl/runat) | ||
[](https://goreportcard.com/report/github.com/qvl/runat) | ||
|
||
|
||
Like [runwhen](http://code.dogmap.org/runwhen/) but simpler: | ||
|
||
## Syntax | ||
``` | ||
runat -a b ... | ||
``` | ||
|
||
with: | ||
|
||
``` | ||
month in 1,...,12 | ||
day in 1,...,31 | ||
weekday in mo,tu,we,th,fr,sa,su | ||
hour in 0,...,24 | ||
minute in 0,...,60 | ||
second in 0,...,60 | ||
``` | ||
|
||
(24/60 alias to 0) | ||
|
||
|
||
## Examples | ||
|
||
``` sh | ||
# Every day at 1am | ||
runat -hour 1 && ~/bin/dbbackup.sh | ||
# Every 1st of month at 1am | ||
runat -day 1 -hour 1 && ~/bin/letsencrypt-renew.sh | ||
# Every 15 minutes | ||
runat -minute 0,15,30,45 ~/bin/dbbackup.sh | ||
``` | ||
|
||
|
||
- Trigger right away on `SIGALRM` | ||
- Waits forever (or til `SIGALRM`) when run without any conditions | ||
- Logs next execution time (to stderr) before sleeping when `-verbose` is active | ||
|
||
|
||
## Install | ||
|
||
- Via [Go](https://golang.org/) setup: `go get qvl.io/runat` | ||
|
||
- Or download latest binary: https://github.com/qvl/runat/releases | ||
|
||
|
||
## Setup | ||
|
||
*TODO* | ||
|
||
|
||
## Use as Go package | ||
|
||
From another Go program you can directly use the `runat` sub-package. | ||
Have a look at the [GoDoc](https://godoc.org/qvl.io/runat/runat). | ||
|
||
|
||
## Development | ||
|
||
Make sure to use `gofmt` and create a [Pull Request](https://github.com/qvl/runat/pulls). | ||
|
||
### Releasing | ||
|
||
Run `./release.sh <version>` and upload the binaries on Github. | ||
|
||
|
||
## License | ||
|
||
[MIT](./license) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
|
||
NAME="runat" | ||
# from args | ||
VERSION="${1}" | ||
test ${VERSION} || (echo "Usage: ./release.sh <version>" && exit 1) | ||
|
||
mkdir -p releases | ||
cd releases | ||
|
||
build () { | ||
BUILD="${1}" | ||
OS="${2}" | ||
ARCH="${3}" | ||
ZIP="${NAME}-${VERSION}-${BUILD}.zip" | ||
echo "Building ${BUILD}" | ||
GOOS=${OS} GOARCH=${ARCH} go build -v -o="${NAME}" -ldflags="-s -w" .. | ||
echo "Creating zip file ${ZIP}" | ||
zip ${ZIP} ${NAME} ../readme.md ../license | ||
rm ${NAME} | ||
} | ||
|
||
|
||
build Windows-64bit windows amd64 | ||
build MacOS-64bit darwin amd64 | ||
build Linux-64bit linux amd64 |