mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-25 06:30:29 +01:00
handle errors on container restart
This commit is contained in:
parent
5334ff1a5a
commit
a0fe2cf42d
@ -37,7 +37,7 @@ func main() {
|
|||||||
|
|
||||||
s.must(func() error {
|
s.must(func() error {
|
||||||
restartContainers, err := s.stopContainers()
|
restartContainers, err := s.stopContainers()
|
||||||
defer restartContainers()
|
defer s.must(restartContainers())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -391,9 +391,10 @@ func (s *script) pruneOldBackups() error {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
s.logger.Infof(
|
s.logger.Infof(
|
||||||
"Pruned %d out of %d remote backup(s) as their age exceeded the configured retention period.",
|
"Pruned %d out of %d remote backup(s) as their age exceeded the configured retention period of %d days.",
|
||||||
len(matches),
|
len(matches),
|
||||||
lenCandidates,
|
lenCandidates,
|
||||||
|
s.c.BackupRetentionDays,
|
||||||
)
|
)
|
||||||
} else if len(matches) != 0 && len(matches) == lenCandidates {
|
} else if len(matches) != 0 && len(matches) == lenCandidates {
|
||||||
s.logger.Warnf(
|
s.logger.Warnf(
|
||||||
@ -447,9 +448,10 @@ func (s *script) pruneOldBackups() error {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
s.logger.Infof(
|
s.logger.Infof(
|
||||||
"Pruned %d out of %d local backup(s) as their age exceeded the configured retention period.",
|
"Pruned %d out of %d local backup(s) as their age exceeded the configured retention period of %d days.",
|
||||||
len(matches),
|
len(matches),
|
||||||
len(candidates),
|
len(candidates),
|
||||||
|
s.c.BackupRetentionDays,
|
||||||
)
|
)
|
||||||
} else if len(matches) != 0 && len(matches) == len(candidates) {
|
} else if len(matches) != 0 && len(matches) == len(candidates) {
|
||||||
s.logger.Warnf(
|
s.logger.Warnf(
|
||||||
|
Loading…
Reference in New Issue
Block a user