Ignore symlinks with missing target, add better backup logging, update copyright year to 2021
This commit is contained in:
@@ -152,7 +152,12 @@ func (a *Archive) addToArchive(p string, rp string, w *tar.Writer) error {
|
||||
if s.Mode()&os.ModeSymlink != 0 {
|
||||
// Read the target of the symlink.
|
||||
target, err = os.Readlink(s.Name())
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
if err != nil {
|
||||
// Skip symlinks if the target does not exist.
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.WithMessagef(err, "failed to read symlink target for '%s'", rp)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user