mirror of
https://kolaente.dev/konrad/docker-db-backup.git
synced 2026-01-10 21:20: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 (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -10,6 +11,7 @@ func main() {
|
|||||||
log.Fatalf("Could not create client: %s", err)
|
log.Fatalf("Could not create client: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
updateFullBackupPath()
|
updateFullBackupPath()
|
||||||
|
|
||||||
containers, err := getContainers(c)
|
containers, err := getContainers(c)
|
||||||
@@ -29,5 +31,9 @@ func main() {
|
|||||||
log.Fatalf("Could not dump databases: %s", err)
|
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