Added backup --dry-run option.

This commit is contained in:
niknah
2017-09-06 19:19:36 +10:00
parent 197d20f0e0
commit 457e518151
5 changed files with 35 additions and 12 deletions

View File

@@ -134,10 +134,12 @@ func (uploader *ChunkUploader) Upload(threadIndex int, task ChunkUploadTask) boo
return false
}
err = uploader.storage.UploadFile(threadIndex, chunkPath, chunk.GetBytes())
if err != nil {
LOG_ERROR("UPLOAD_CHUNK", "Failed to upload the chunk %s: %v", chunkID, err)
return false
if !uploader.config.dryRun {
err = uploader.storage.UploadFile(threadIndex, chunkPath, chunk.GetBytes())
if err != nil {
LOG_ERROR("UPLOAD_CHUNK", "Failed to upload the chunk %s: %v", chunkID, err)
return false
}
}
LOG_DEBUG("CHUNK_UPLOAD", "Chunk %s has been uploaded", chunkID)