Add an -enum-only option to the backup command to enumerate the repository only

This commit is contained in:
Gilbert Chen
2018-05-24 11:34:46 -04:00
parent 72239a31c4
commit aadd2aa390
5 changed files with 32 additions and 12 deletions

View File

@@ -714,13 +714,14 @@ func backupRepository(context *cli.Context) {
dryRun := context.Bool("dry-run")
uploadRateLimit := context.Int("limit-rate")
enumOnly := context.Bool("enum-only")
storage.SetRateLimits(0, uploadRateLimit)
backupManager := duplicacy.CreateBackupManager(preference.SnapshotID, storage, repository, password, preference.NobackupFile)
duplicacy.SavePassword(*preference, "password", password)
backupManager.SetupSnapshotCache(preference.Name)
backupManager.SetDryRun(dryRun)
backupManager.Backup(repository, quickMode, threads, context.String("t"), showStatistics, enableVSS, vssTimeout)
backupManager.Backup(repository, quickMode, threads, context.String("t"), showStatistics, enableVSS, vssTimeout, enumOnly)
runScript(context, preference.Name, "post")
}
@@ -1363,6 +1364,10 @@ func main() {
Usage: "backup to the specified storage instead of the default one",
Argument: "<storage name>",
},
cli.BoolFlag{
Name: "enum-only",
Usage: "enumerate the repository recursively and then exit",
},
},
Usage: "Save a snapshot of the repository to the storage",
ArgsUsage: " ",