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:
8
main.go
8
main.go
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user