mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-01-10 01:22:37 +01:00
Compare commits
25 Commits
v2.36.1
...
v2.36.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87ea8d0930 | ||
|
|
7d489a95e3 | ||
|
|
57e7f2af9e | ||
|
|
4639b21f3b | ||
|
|
9acd6dc8ab | ||
|
|
409496af24 | ||
|
|
542d1fa69f | ||
|
|
2bc94d8a5b | ||
|
|
26bbc66cd5 | ||
|
|
09cc1f5c60 | ||
|
|
7ad6fc9355 | ||
|
|
bb37b8b1d8 | ||
|
|
bf1d13b78c | ||
|
|
538a069a70 | ||
|
|
78a89c1a93 | ||
|
|
94aa33369f | ||
|
|
f4497177b5 | ||
|
|
95e9e9945d | ||
|
|
fee8cb234c | ||
|
|
b7855605d4 | ||
|
|
f14b796aab | ||
|
|
978e900308 | ||
|
|
511b79bd43 | ||
|
|
8ef7fa0d5d | ||
|
|
270ca65efa |
@@ -15,9 +15,7 @@ func main() {
|
||||
}
|
||||
|
||||
unlock, err := s.lock("/var/lock/dockervolumebackup.lock")
|
||||
defer func() {
|
||||
s.must(unlock())
|
||||
}()
|
||||
defer s.must(unlock())
|
||||
s.must(err)
|
||||
|
||||
defer func() {
|
||||
|
||||
@@ -170,23 +170,26 @@ func (s *script) stopContainersAndServices() (func() error, error) {
|
||||
}
|
||||
}
|
||||
|
||||
s.logger.Info(
|
||||
fmt.Sprintf(
|
||||
"Stopping %d out of %d running container(s) as they were labeled %s.",
|
||||
len(containersToStop),
|
||||
len(allContainers),
|
||||
filterMatchLabel,
|
||||
),
|
||||
)
|
||||
if isDockerSwarm {
|
||||
s.logger.Info(
|
||||
fmt.Sprintf(
|
||||
"Scaling down %d out of %d active service(s) as they were labeled %s.",
|
||||
"Stopping %d out of %d running container(s) and scaling down %d out of %d active service(s) as they were labeled %s.",
|
||||
len(containersToStop),
|
||||
len(allContainers),
|
||||
len(servicesToScaleDown),
|
||||
len(allServices),
|
||||
filterMatchLabel,
|
||||
),
|
||||
)
|
||||
} else {
|
||||
s.logger.Info(
|
||||
fmt.Sprintf(
|
||||
"Stopping %d out of %d running container(s) as they were labeled %s.",
|
||||
len(containersToStop),
|
||||
len(allContainers),
|
||||
filterMatchLabel,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
var stoppedContainers []types.Container
|
||||
@@ -317,20 +320,21 @@ func (s *script) stopContainersAndServices() (func() error, error) {
|
||||
errors.Join(allErrors...),
|
||||
)
|
||||
}
|
||||
|
||||
s.logger.Info(
|
||||
fmt.Sprintf(
|
||||
"Restarted %d container(s).",
|
||||
len(stoppedContainers),
|
||||
),
|
||||
)
|
||||
if isDockerSwarm {
|
||||
s.logger.Info(
|
||||
fmt.Sprintf(
|
||||
"Scaled %d service(s) back up.",
|
||||
"Restarted %d container(s) and %d service(s).",
|
||||
len(stoppedContainers),
|
||||
len(scaledDownServices),
|
||||
),
|
||||
)
|
||||
} else {
|
||||
s.logger.Info(
|
||||
fmt.Sprintf(
|
||||
"Restarted %d container(s).",
|
||||
len(stoppedContainers),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
2
go.mod
2
go.mod
@@ -10,7 +10,7 @@ require (
|
||||
github.com/docker/cli v24.0.1+incompatible
|
||||
github.com/docker/docker v24.0.7+incompatible
|
||||
github.com/gofrs/flock v0.8.1
|
||||
github.com/klauspost/compress v1.17.5
|
||||
github.com/klauspost/compress v1.17.4
|
||||
github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d
|
||||
github.com/minio/minio-go/v7 v7.0.66
|
||||
github.com/offen/envconfig v1.5.0
|
||||
|
||||
4
go.sum
4
go.sum
@@ -456,8 +456,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
|
||||
github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
|
||||
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
|
||||
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||
|
||||
Reference in New Issue
Block a user