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

@@ -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")
@@ -1202,6 +1204,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)",