Add basic structure

This commit is contained in:
2025-06-27 18:01:50 +02:00
commit fbbee71052
5 changed files with 48 additions and 0 deletions

3
crontab/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module crontab
go 1.23.6

12
crontab/main.go Normal file
View 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
View 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
View 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
View 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)
}