From 089df7d977f7a4e9e372d0f93c5700ff7beda14e Mon Sep 17 00:00:00 2001 From: nielash Date: Fri, 25 Aug 2023 03:14:37 -0400 Subject: [PATCH] bisync: add rc parameters for new flags Added rc support for the flags recently introduced in #6971. createEmptySrcDirs ignoreListingChecksum resilient --- cmd/bisync/help.go | 7 ++++++- cmd/bisync/rc.go | 12 ++++++++++++ docs/content/rc.md | 9 +++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/cmd/bisync/help.go b/cmd/bisync/help.go index 14e6f7866..84e78ab9d 100644 --- a/cmd/bisync/help.go +++ b/cmd/bisync/help.go @@ -27,11 +27,16 @@ var rcHelp = makeHelp(`This takes the following parameters - checkFilename - file name for checkAccess (default: {CHECKFILE}) - maxDelete - abort sync if percentage of deleted files is above this threshold (default: {MAXDELETE}) -- force - maxDelete safety check and run the sync +- force - Bypass maxDelete safety check and run the sync - checkSync - |true| by default, |false| disables comparison of final listings, |only| will skip sync, only compare listings from the last run +- createEmptySrcDirs - Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) - removeEmptyDirs - remove empty directories at the final cleanup step - filtersFile - read filtering patterns from a file +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. + Use at your own risk! - workdir - server directory for history files (default: {WORKDIR}) - noCleanup - retain working files diff --git a/cmd/bisync/rc.go b/cmd/bisync/rc.go index 6989b6436..36c028877 100644 --- a/cmd/bisync/rc.go +++ b/cmd/bisync/rc.go @@ -48,12 +48,21 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if opt.Force, err = in.GetBool("force"); rc.NotErrParamNotFound(err) { return } + if opt.CreateEmptySrcDirs, err = in.GetBool("createEmptySrcDirs"); rc.NotErrParamNotFound(err) { + return + } if opt.RemoveEmptyDirs, err = in.GetBool("removeEmptyDirs"); rc.NotErrParamNotFound(err) { return } if opt.NoCleanup, err = in.GetBool("noCleanup"); rc.NotErrParamNotFound(err) { return } + if opt.IgnoreListingChecksum, err = in.GetBool("ignoreListingChecksum"); rc.NotErrParamNotFound(err) { + return + } + if opt.Resilient, err = in.GetBool("resilient"); rc.NotErrParamNotFound(err) { + return + } if opt.CheckFilename, err = in.GetString("checkFilename"); rc.NotErrParamNotFound(err) { return @@ -69,6 +78,9 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if rc.NotErrParamNotFound(err) { return nil, err } + if checkSync == "" { + checkSync = "true" + } if err := opt.CheckSync.Set(checkSync); err != nil { return nil, err } diff --git a/docs/content/rc.md b/docs/content/rc.md index 5f4797800..bfc058297 100644 --- a/docs/content/rc.md +++ b/docs/content/rc.md @@ -1650,12 +1650,17 @@ This takes the following parameters - checkFilename - file name for checkAccess (default: RCLONE_TEST) - maxDelete - abort sync if percentage of deleted files is above this threshold (default: 50) -- force - maxDelete safety check and run the sync +- force - Bypass maxDelete safety check and run the sync - checkSync - `true` by default, `false` disables comparison of final listings, `only` will skip sync, only compare listings from the last run +- createEmptySrcDirs - Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) - removeEmptyDirs - remove empty directories at the final cleanup step - filtersFile - read filtering patterns from a file -- workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync) +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. + Use at your own risk! +- workdir - Use custom working directory (default: `~/.cache/rclone/bisync`) - noCleanup - retain working files See [bisync command help](https://rclone.org/commands/rclone_bisync/)