3
0
mirror of https://kolaente.dev/konrad/docker-db-backup.git synced 2026-01-10 03:00:08 +01:00

feat: add cron schedule

This commit is contained in:
kolaente
2021-12-05 13:42:35 +01:00
parent 2a477f49a2
commit 3508c5a26e

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)
}
}