Zcrontab
zcrontab is a ticker based crontab task, support all crontab symbol,and crond is not needed
Install / Use
/learn @zzerroo/ZcrontabREADME
ZCrontab
zcrontab is a crontab、at task processor based on golang:
-
based on time.ticker,no need of crond service
-
support task deletion and callback
-
crontab
- the crontab task support all crontab symbol including *,-,/,,
-
at
- the at task can be repeated at the same time(every day)
Usage
Install
glide get github.com/zzerroo/zcrontab
example
import (
"fmt"
"time"
"ztimer/zcrontab"
)
func test(args interface{}) {
fmt.Println(args)
}
func main() {
zCrontab := zcrontab.NewZCrontab()
zCrontab.Crontab("* * * * *", test, "*")
zCrontab.Crontab("*/2 * * * *", test, "every 2 minute")
zCrontab.Crontab("* 15 * * *", test, "every minute 3")
zCrontab.Crontab("*/2 15,16 * * *", test, "every 2 minute 3,4")
zCrontab.Crontab("*/2 15-16 * * *", test, "every 2 minute 3-4")
zCrontab.Crontab("* 15-16/2 * * *", test, "every minute 3-4/3")
zCrontab.At(time.Now().Add(1*time.Minute), test, "this is test for at repeat", true)
zCrontab.At(time.Now().Add(1*time.Minute), test, "this is test for at", false)
select {}
}
Related Skills
xurl
344.1kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
openhue
344.1kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
344.1kElevenLabs text-to-speech with mac-style say UX.
weather
344.1kGet current weather and forecasts via wttr.in or Open-Meteo
