Merge pull request #180 from niknah/dry_run

Added backup --dry-run option.
This commit is contained in:
gilbertchen
2017-09-18 22:32:21 -04:00
committed by GitHub
6 changed files with 41 additions and 20 deletions

View File

@@ -623,12 +623,14 @@ func backupRepository(context *cli.Context) {
enableVSS := context.Bool("vss")
dryRun := context.Bool("dry-run")
uploadRateLimit := context.Int("limit-rate")
storage.SetRateLimits(0, uploadRateLimit)
backupManager := duplicacy.CreateBackupManager(preference.SnapshotID, storage, repository, password)
duplicacy.SavePassword(*preference, "password", password)
backupManager.SetupSnapshotCache(preference.Name)
backupManager.SetDryRun(dryRun)
backupManager.Backup(repository, quickMode, threads, context.String("t"), showStatistics, enableVSS)
runScript(context, preference.Name, "post")
@@ -1211,6 +1213,10 @@ func main() {
Usage: "the maximum upload rate (in kilobytes/sec)",
Argument: "<kB/s>",
},
cli.BoolFlag {
Name: "dry-run",
Usage: "Dry run for testing, don't backup anything. Use with -stats and -d",
},
cli.BoolFlag {
Name: "vss",
Usage: "enable the Volume Shadow Copy service (Windows only)",