feat: add cron schedule

This commit is contained in:
kolaente 2021-12-05 13:42:35 +01:00
parent 2a477f49a2
commit 3508c5a26e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 24 additions and 18 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"log"
"time"
)
func main() {
@ -10,6 +11,7 @@ func main() {
log.Fatalf("Could not create client: %s", err)
}
for {
updateFullBackupPath()
containers, err := getContainers(c)
@ -29,5 +31,9 @@ func main() {
log.Fatalf("Could not dump databases: %s", err)
}
// TODO: Cron
log.Println("Done.")
log.Printf("Sleeping for %s\n", config.Interval)
time.Sleep(config.Interval)
}
}