16 Star 54 Fork 13

DiDi-opensource/sgt

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cron.go 538 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ulric Qin 提交于 2018-10-12 13:22 +08:00 . push to github
package cron
import (
"log"
"sgt/pkg/file"
)
const sgd_cron_content = `SHELL=/bin/bash
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:~/bin
MAILTO=root
* * * * * root timeout 3 /usr/local/sgd/control start &>/dev/null
`
func Init() {
err := file.EnsureDir("/etc/cron.d")
if err != nil {
log.Printf("ERR: cannot exec mkdir -p /etc/cron.d: %v", err)
return
}
_, err = file.WriteString("/etc/cron.d/sgd", sgd_cron_content)
if err != nil {
log.Printf("ERR: cannot write sgd cron: %v", err)
return
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/didiopensource/sgt.git
git@gitee.com:didiopensource/sgt.git
didiopensource
sgt
sgt
3c772d0974fe

搜索帮助