mirror of
https://github.com/offen/docker-volume-backup.git
synced 2025-12-05 17:18:02 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c666d0c88 | ||
|
|
a0402b407d |
@@ -518,15 +518,16 @@ func (s *script) pruneOldBackups() error {
|
|||||||
|
|
||||||
var candidates []string
|
var candidates []string
|
||||||
for _, candidate := range globMatches {
|
for _, candidate := range globMatches {
|
||||||
fi, err := os.Stat(candidate)
|
fi, err := os.Lstat(candidate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
"pruneOldBackups: error calling stat on file %s: %w",
|
"pruneOldBackups: error calling Lstat on file %s: %w",
|
||||||
candidate,
|
candidate,
|
||||||
err,
|
err,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if fi.Mode() != os.ModeSymlink {
|
|
||||||
|
if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
|
||||||
candidates = append(candidates, candidate)
|
candidates = append(candidates, candidate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user