docker-db-backup/main.go

31 lines
488 B
Go
Raw Normal View History

2021-08-18 17:47:49 +00:00
package main
2021-08-18 19:50:15 +00:00
import (
"log"
)
2021-08-18 17:47:49 +00:00
func main() {
2021-08-18 19:50:15 +00:00
c, err := getClient()
if err != nil {
log.Fatalf("Could not create client: %s", err)
}
updateFullBackupPath()
containers, err := getContainers(c)
if err != nil {
log.Fatalf("Could not get containers: %s", err)
}
storeContainers(c, containers)
err = dumpAllDatabases(c)
2021-08-18 19:50:15 +00:00
if err != nil {
// TODO: Only log errors while dumping dbs
log.Fatalf("Could not dump databases: %s", err)
}
// TODO: Cron
// TODO: Cleanup old
2021-08-18 17:47:49 +00:00
}