Skip to content

Commit

Permalink
fix download RBAC/Configs error not exists for SFTP
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Aug 3, 2023
1 parent 6bfab10 commit 562fed9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/backup/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,12 @@ func (b *Backuper) downloadBackupRelatedDir(ctx context.Context, remoteBackup st
return uint64(processedSize), nil
}
}

if remoteBackup.DataFormat == DirectoryFormat {
if err := b.dst.DownloadPath(ctx, 0, remoteSource, localDir, b.cfg.General.RetriesOnFailure, b.cfg.General.RetriesDuration); err != nil {
return 0, err
//SFTP can't walk on non exists paths and return error
if !strings.Contains(err.Error(), "not exist") {
return 0, err
}
}
downloadedBytes := int64(0)
if _, err := os.Stat(localDir); err != nil && os.IsNotExist(err) {
Expand Down

0 comments on commit 562fed9

Please sign in to comment.