mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 00:30:29 +01:00
use lstat when checking whether file is a symlink
This commit is contained in:
parent
a0402b407d
commit
0c666d0c88
@ -518,10 +518,10 @@ 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,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user