Skip to content

Commit

Permalink
check diff-from backup is exists
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAkulov committed Apr 14, 2019
1 parent 1db3541 commit 9f022c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ func (s *S3) CompressedStreamUpload(localPath, s3Path, diffFromPath string) erro
defer bar.FinishPrint("Done.")
}
if diffFromPath != "" {
fi, err := os.Stat(diffFromPath)
if err != nil {
return err
}
if !fi.IsDir() {
return fmt.Errorf("'%s' is not a directory", diffFromPath)
}
if isClickhouseShadow(filepath.Join(diffFromPath, "shadow")) {
return fmt.Errorf("'%s' is old format backup and doesn't supports diff", filepath.Base(diffFromPath))
}
Expand Down

0 comments on commit 9f022c3

Please sign in to comment.