cron library
cron_test
cron is a crontab in golang(just a library)
Source code: github.com/robfig/cron
//every 5 second run a job
var spec5s = "0-59/5 * * * * *"
st := &stat{
mac: 1000,
}
c.AddJob(spec5s, st)
//every day(00:00:00) run a job
var specday = "0 0 0 1-31 * *"
day := &day{
id: 9000,
}
c.AddJob(specday, day)
Run as a daemon service
nohup cron_test >test.log 2>&1 &