1
0
mirror of https://github.com/offen/docker-volume-backup.git synced 2025-07-11 14:40:11 +02:00

update github.com/otai/copy, use PreserveOwner option

This commit is contained in:
Frederik Ring
2021-11-29 08:40:55 +01:00
parent dfd0d617e4
commit 5a6ce81b58
3 changed files with 9 additions and 6 deletions

View File

@ -356,7 +356,10 @@ func (s *script) takeBackup() error {
s.logger.Infof("Removed snapshot `%s`.", backupSources)
return nil
})
if err := copy.Copy(s.c.BackupSources, backupSources, copy.Options{PreserveTimes: true}); err != nil {
if err := copy.Copy(s.c.BackupSources, backupSources, copy.Options{
PreserveTimes: true,
PreserveOwner: true,
}); err != nil {
return fmt.Errorf("takeBackup: error creating snapshot: %w", err)
}
s.logger.Infof("Created snapshot of `%s` at `%s`.", s.c.BackupSources, backupSources)