Add basic structure
This commit is contained in:
3
crontab/go.mod
Normal file
3
crontab/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module crontab
|
||||
|
||||
go 1.23.6
|
12
crontab/main.go
Normal file
12
crontab/main.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
logger "git.site.quack-lab.dev/dave/cylogger"
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
logger.InitFlag()
|
||||
}
|
5
crontabd/go.mod
Normal file
5
crontabd/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module crontabd
|
||||
|
||||
go 1.23.6
|
||||
|
||||
require git.site.quack-lab.dev/dave/cylogger v1.2.3
|
2
crontabd/go.sum
Normal file
2
crontabd/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
git.site.quack-lab.dev/dave/cylogger v1.2.3 h1:g6fwgrd3HvGsxljvKbjcFaMynTO2AZFWjC2ZvCi1raQ=
|
||||
git.site.quack-lab.dev/dave/cylogger v1.2.3/go.mod h1:sf16Zs5ZRncn0ySgwxRJShkge1M10CM2RAUkKn8Bel8=
|
26
crontabd/main.go
Normal file
26
crontabd/main.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
logger "git.site.quack-lab.dev/dave/cylogger"
|
||||
)
|
||||
|
||||
var crontabFile string
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
logger.InitFlag()
|
||||
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
logger.Error("Failed to get user home directory: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
userName := os.Getenv("USERNAME")
|
||||
crontabFile = filepath.Join(homeDir, "crontab", userName+".cron")
|
||||
logger.Info("Crontab file: %s", crontabFile)
|
||||
}
|
Reference in New Issue
Block a user