"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
bisync: add --resync-mode for customizing --resync - fixes #5681
nielash810644e87353
diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.goindex a3e08fefa..288371b7f 100644--- a/cmd/bisync/bisync_test.go+++ b/cmd/bisync/bisync_test.go@@ -205,6 +205,7 @@ func TestBisync(t *testing.T) {ci.RefreshTimes = true}bisync.Colors = true+ time.Local, _ = time.LoadLocation("America/New_York")baseDir, err := os.Getwd()require.NoError(t, err, "get current directory")@@ -865,6 +866,8 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) {_ = opt.ConflictLoser.Set(val)case "conflict-suffix":opt.ConflictSuffixFlag = val+ case "resync-mode":+ _ = opt.ResyncMode.Set(val)default:return fmt.Errorf("invalid bisync option %q", arg)}diff --git a/cmd/bisync/checkfn.go b/cmd/bisync/checkfn.goindex c5d5c12b5..8cc6e13c4 100644--- a/cmd/bisync/checkfn.go+++ b/cmd/bisync/checkfn.go@@ -208,7 +208,14 @@ func (b *bisyncRun) EqualFn(ctx context.Context) context.Context {fs.Debugf(src, "equal skipped")}ctxNoLogger := operations.WithLogger(ctx, noop)- if operations.Equal(ctxNoLogger, src, dst) {++ timeSizeEqualFn := func() (equal bool, skipHash bool) { return operations.Equal(ctxNoLogger, src, dst), false } // normally use Equal()+ if b.opt.ResyncMode == PreferOlder || b.opt.ResyncMode == PreferLarger || b.opt.ResyncMode == PreferSmaller {+ timeSizeEqualFn = func() (equal bool, skipHash bool) { return b.resyncTimeSizeEqual(ctxNoLogger, src, dst) } // but override for --resync-mode older, larger, smaller+ }+ skipHash := false // (note that we might skip it anyway based on compare/ht settings)+ equal, skipHash = timeSizeEqualFn()+ if equal && !skipHash {whichHashType := func(f fs.Info) hash.Type {ht := getHashType(f.Name())if ht == hash.None && b.opt.Compare.SlowHashSyncOnly && !b.opt.Resync {@@ -233,3 +240,32 @@ func (b *bisyncRun) EqualFn(ctx context.Context) context.Context {}return operations.WithEqualFn(ctx, equalFn)}++func (b *bisyncRun) resyncTimeSizeEqual(ctxNoLogger context.Context, src fs.ObjectInfo, dst fs.Object) (equal bool, skipHash bool) {+ switch b.opt.ResyncMode {+ case PreferLarger, PreferSmaller:+ // note that arg order is path1, path2, regardless of src/dst+ path1, path2 := b.resyncWhichIsWhich(src, dst)+ if sizeDiffers(path1.Size(), path2.Size()) {+ winningPath := b.resolveLargerSmaller(path1.Size(), path2.Size(), path1.Remote(), path2.Remote(), b.opt.ResyncMode)+ // don't need to check/update modtime here, as sizes definitely differ and something will be transferred+ return b.resyncWinningPathToEqual(winningPath), b.resyncWinningPathToEqual(winningPath) // skip hash check if true+ }+ // sizes equal or don't know, so continue to checking time/hash, if applicable+ return operations.Equal(ctxNoLogger, src, dst), false // note we're back to src/dst, not path1/path2+ case PreferOlder:+ // note that arg order is path1, path2, regardless of src/dst+ path1, path2 := b.resyncWhichIsWhich(src, dst)+ if timeDiffers(ctxNoLogger, path1.ModTime(ctxNoLogger), path2.ModTime(ctxNoLogger), path1.Fs(), path2.Fs()) {+ winningPath := b.resolveNewerOlder(path1.ModTime(ctxNoLogger), path2.ModTime(ctxNoLogger), path1.Remote(), path2.Remote(), b.opt.ResyncMode)+ // if src is winner, proceed with equal to check size/hash and possibly just update dest modtime instead of transferring+ if !b.resyncWinningPathToEqual(winningPath) {+ return operations.Equal(ctxNoLogger, src, dst), false // note we're back to src/dst, not path1/path2+ }+ // if dst is winner (and definitely unequal), do not proceed further as we want dst to overwrite src regardless of size difference, and we do not want dest modtime updated+ return true, true+ }+ // times equal or don't know, so continue to checking size/hash, if applicable+ }+ return operations.Equal(ctxNoLogger, src, dst), false // note we're back to src/dst, not path1/path2+}diff --git a/cmd/bisync/cmd.go b/cmd/bisync/cmd.goindex 17442c9ea..b57bbf1ee 100644--- a/cmd/bisync/cmd.go+++ b/cmd/bisync/cmd.go@@ -30,7 +30,8 @@ type TestFunc func()// Options keep bisync optionstype Options struct {- Resync bool+ Resync bool // whether or not this is a resync+ ResyncMode Prefer // which mode to use for resyncCheckAccess boolCheckFilename stringCheckSync CheckSyncMode@@ -123,7 +124,8 @@ func init() {cmdFlags := commandDefinition.Flags()// when adding new flags, remember to also update the rc params:// cmd/bisync/rc.go cmd/bisync/help.go (not docs/content/rc.md)- flags.BoolVarP(cmdFlags, &Opt.Resync, "resync", "1", Opt.Resync, "Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.", "")+ flags.BoolVarP(cmdFlags, &Opt.Resync, "resync", "1", Opt.Resync, "Performs the resync run. Equivalent to --resync-mode path1. Consider using --verbose or --dry-run first.", "")+ flags.FVarP(cmdFlags, &Opt.ResyncMode, "resync-mode", "", "During resync, prefer the version that is: path1, path2, newer, older, larger, smaller (default: path1 if --resync, otherwise none for no resync.)", "")flags.BoolVarP(cmdFlags, &Opt.CheckAccess, "check-access", "", Opt.CheckAccess, makeHelp("Ensure expected {CHECKFILE} files are found on both Path1 and Path2 filesystems, else abort."), "")flags.StringVarP(cmdFlags, &Opt.CheckFilename, "check-filename", "", Opt.CheckFilename, makeHelp("Filename for --check-access (default: {CHECKFILE})"), "")flags.BoolVarP(cmdFlags, &Opt.Force, "force", "", Opt.Force, "Bypass --max-delete safety check and run the sync. Consider using with --verbose", "")@@ -149,6 +151,8 @@ func init() {flags.FVarP(cmdFlags, &Opt.ConflictResolve, "conflict-resolve", "", "Automatically resolve conflicts by preferring the version that is: "+ConflictResolveList+" (default: none)", "")flags.FVarP(cmdFlags, &Opt.ConflictLoser, "conflict-loser", "", "Action to take on the loser of a sync conflict (when there is a winner) or on both files (when there is no winner): "+ConflictLoserList+" (default: num)", "")flags.StringVarP(cmdFlags, &Opt.ConflictSuffixFlag, "conflict-suffix", "", Opt.ConflictSuffixFlag, "Suffix to use when renaming a --conflict-loser. Can be either one string or two comma-separated strings to assign different suffixes to Path1/Path2. (default: 'conflict')", "")+ _ = cmdFlags.MarkHidden("debugname")+ _ = cmdFlags.MarkHidden("localtime")}// bisync command definitiondiff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.goindex 79ed630f3..432ceaee4 100644--- a/cmd/bisync/operations.go+++ b/cmd/bisync/operations.go@@ -50,6 +50,7 @@ type bisyncRun struct {DebugName stringlockFile stringrenames renames+ resyncIs1to2 bool}type queues struct {@@ -89,6 +90,9 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) {if err != nil {return err}++ b.setResyncDefaults()+err = b.setResolveDefaults(ctx)if err != nil {return errdiff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.goindex 120b9e9bd..8b5cd0801 100644--- a/cmd/bisync/queue.go+++ b/cmd/bisync/queue.go@@ -202,6 +202,11 @@ func (b *bisyncRun) preCopy(ctx context.Context) context.Context {// otherwise impossible in Sync, so override Equalctx = b.EqualFn(ctx)}+ if b.opt.ResyncMode == PreferOlder || b.opt.ResyncMode == PreferLarger || b.opt.ResyncMode == PreferSmaller {+ overridingEqual = true+ fs.Debugf(nil, "overriding equal")+ ctx = b.EqualFn(ctx)+ }ctxCopyLogger := operations.WithSyncLogger(ctx, logger)if b.opt.Compare.Checksum && (b.opt.Compare.NoSlowHash || b.opt.Compare.SlowHashSyncOnly) && b.opt.Compare.SlowHashDetected {// set here in case !b.opt.Compare.Modtimediff --git a/cmd/bisync/resolve.go b/cmd/bisync/resolve.goindex 4daa9527b..e9c57a7d0 100644--- a/cmd/bisync/resolve.go+++ b/cmd/bisync/resolve.go@@ -44,7 +44,7 @@ func (preferChoices) Choices() []string {}func (preferChoices) Type() string {- return "Prefer"+ return "string"}// ConflictResolveList is a list of --conflict-resolve flag choices used in the help@@ -373,21 +373,22 @@ func (b *bisyncRun) conflictWinner(ds1, ds2 *deltaSet, remote1, remote2 string)case PreferPath2:return 2case PreferNewer, PreferOlder:- return b.resolveNewerOlder(ds1, ds2, remote1, remote2, b.opt.ConflictResolve)+ t1, t2 := ds1.time[remote1], ds2.time[remote2]+ return b.resolveNewerOlder(t1, t2, remote1, remote2, b.opt.ConflictResolve)case PreferLarger, PreferSmaller:- return b.resolveLargerSmaller(ds1, ds2, remote1, remote2, b.opt.ConflictResolve)+ s1, s2 := ds1.size[remote1], ds2.size[remote2]+ return b.resolveLargerSmaller(s1, s2, remote1, remote2, b.opt.ConflictResolve)default:return 0}}// returns the winning path number, or 0 if winner can't be determined-func (b *bisyncRun) resolveNewerOlder(ds1, ds2 *deltaSet, remote1, remote2 string, prefer Prefer) int {+func (b *bisyncRun) resolveNewerOlder(t1, t2 time.Time, remote1, remote2 string, prefer Prefer) int {if fs.GetModifyWindow(b.octx, b.fs1, b.fs2) == fs.ModTimeNotSupported {fs.Infof(remote1, "Winner cannot be determined as at least one path lacks modtime support.")return 0}- t1, t2 := ds1.time[remote1], ds2.time[remote2]if t1.IsZero() || t2.IsZero() {fs.Infof(remote1, "Winner cannot be determined as at least one modtime is missing. Path1: %v, Path2: %v", t1, t2)return 0@@ -418,8 +419,7 @@ func (b *bisyncRun) resolveNewerOlder(ds1, ds2 *deltaSet, remote1, remote2 strin}// returns the winning path number, or 0 if winner can't be determined-func (b *bisyncRun) resolveLargerSmaller(ds1, ds2 *deltaSet, remote1, remote2 string, prefer Prefer) int {- s1, s2 := ds1.size[remote1], ds2.size[remote2]+func (b *bisyncRun) resolveLargerSmaller(s1, s2 int64, remote1, remote2 string, prefer Prefer) int {if s1 < 0 || s2 < 0 {fs.Infof(remote1, "Winner cannot be determined as at least one size is unknown. Path1: %v, Path2: %v", s1, s2)return 0diff --git a/cmd/bisync/resync.go b/cmd/bisync/resync.goindex 7d2bd9760..b3fc7ed8d 100644--- a/cmd/bisync/resync.go+++ b/cmd/bisync/resync.go@@ -8,13 +8,41 @@ import ("github.com/rclone/rclone/cmd/bisync/bilib""github.com/rclone/rclone/fs""github.com/rclone/rclone/fs/filter"+ "github.com/rclone/rclone/lib/terminal")+// for backward compatibility, --resync is now equivalent to --resync-mode path1+// and either flag is sufficient without the other.+func (b *bisyncRun) setResyncDefaults() {+ if b.opt.Resync && b.opt.ResyncMode == PreferNone {+ fs.Debugf(nil, Color(terminal.Dim, "defaulting to --resync-mode path1 as --resync is set"))+ b.opt.ResyncMode = PreferPath1+ }+ if b.opt.ResyncMode != PreferNone {+ b.opt.Resync = true+ Opt.Resync = true // shouldn't be using this one, but set to be safe+ }++ // checks and warnings+ if (b.opt.ResyncMode == PreferNewer || b.opt.ResyncMode == PreferOlder) && (b.fs1.Precision() == fs.ModTimeNotSupported || b.fs2.Precision() == fs.ModTimeNotSupported) {+ fs.Logf(nil, Color(terminal.YellowFg, "WARNING: ignoring --resync-mode %s as at least one remote does not support modtimes."), b.opt.ResyncMode.String())+ b.opt.ResyncMode = PreferPath1+ } else if (b.opt.ResyncMode == PreferNewer || b.opt.ResyncMode == PreferOlder) && !b.opt.Compare.Modtime {+ fs.Logf(nil, Color(terminal.YellowFg, "WARNING: ignoring --resync-mode %s as --compare does not include modtime."), b.opt.ResyncMode.String())+ b.opt.ResyncMode = PreferPath1+ }+ if (b.opt.ResyncMode == PreferLarger || b.opt.ResyncMode == PreferSmaller) && !b.opt.Compare.Size {+ fs.Logf(nil, Color(terminal.YellowFg, "WARNING: ignoring --resync-mode %s as --compare does not include size."), b.opt.ResyncMode.String())+ b.opt.ResyncMode = PreferPath1+ }+}+// resync implements the --resync mode.-// It will generate path1 and path2 listings-// and copy any unique path2 files to path1.+// It will generate path1 and path2 listings,+// copy any unique files to the opposite path,+// and resolve any differing files according to the --resync-mode.func (b *bisyncRun) resync(octx, fctx context.Context) error {- fs.Infof(nil, "Copying unique Path2 files to Path1")+ fs.Infof(nil, "Copying Path2 files to Path1")// Save blank filelists (will be filled from sync results)var ls1 = newFileList()@@ -74,15 +102,15 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error {var results1to2 []Resultsqueues := queues{}- b.indent("Path2", "Path1", "Resync is copying UNIQUE files to")+ b.indent("Path2", "Path1", "Resync is copying files to")ctxRun := b.opt.setDryRun(fctx)// fctx has our extra filters added!ctxSync, filterSync := filter.AddConfig(ctxRun)if filterSync.Opt.MinSize == -1 {fs.Debugf(nil, "filterSync.Opt.MinSize: %v", filterSync.Opt.MinSize)}- ci := fs.GetConfig(ctxSync)- ci.IgnoreExisting = true+ b.resyncIs1to2 = false+ ctxSync = b.setResyncConfig(ctxSync)ctxSync = b.setBackupDir(ctxSync, 1)// 2 to 1if results2to1, err = b.resyncDir(ctxSync, b.fs2, b.fs1); err != nil {@@ -90,8 +118,9 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error {return err}- b.indent("Path1", "Path2", "Resync is copying UNIQUE OR DIFFERING files to")- ci.IgnoreExisting = false+ b.indent("Path1", "Path2", "Resync is copying files to")+ b.resyncIs1to2 = true+ ctxSync = b.setResyncConfig(ctxSync)ctxSync = b.setBackupDir(ctxSync, 2)// 1 to 2if results1to2, err = b.resyncDir(ctxSync, b.fs1, b.fs2); err != nil {@@ -130,9 +159,68 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error {return err}+ if b.opt.CheckSync == CheckSyncTrue && !b.opt.DryRun {+ path1 := bilib.FsPath(b.fs1)+ path2 := bilib.FsPath(b.fs2)+ fs.Infof(nil, "Validating listings for Path1 %s vs Path2 %s", quotePath(path1), quotePath(path2))+ if err := b.checkSync(b.listing1, b.listing2); err != nil {+ b.critical = true+ return err+ }+ }+if !b.opt.NoCleanup {_ = os.Remove(b.newListing1)_ = os.Remove(b.newListing2)}return nil}++/*+ --resync-mode implementation:+ PreferPath1: set ci.IgnoreExisting true, then false+ PreferPath2: set ci.IgnoreExisting false, then true+ PreferNewer: set ci.UpdateOlder in both directions+ PreferOlder: override EqualFn to implement custom logic+ PreferLarger: override EqualFn to implement custom logic+ PreferSmaller: override EqualFn to implement custom logic+*/+func (b *bisyncRun) setResyncConfig(ctx context.Context) context.Context {+ ci := fs.GetConfig(ctx)+ switch b.opt.ResyncMode {+ case PreferPath1:+ if !b.resyncIs1to2 { // 2to1 (remember 2to1 is first)+ ci.IgnoreExisting = true+ } else { // 1to2+ ci.IgnoreExisting = false+ }+ case PreferPath2:+ if !b.resyncIs1to2 { // 2to1 (remember 2to1 is first)+ ci.IgnoreExisting = false+ } else { // 1to2+ ci.IgnoreExisting = true+ }+ case PreferNewer:+ ci.UpdateOlder = true+ }+ // for older, larger, and smaller, we return it unchanged and handle it later+ return ctx+}++func (b *bisyncRun) resyncWhichIsWhich(src, dst fs.ObjectInfo) (path1, path2 fs.ObjectInfo) {+ if b.resyncIs1to2 {+ return src, dst+ }+ return dst, src+}++// equal in this context really means "don't transfer", so we should+// return true if the files are actually equal or if dest is winner,+// false if src is winner+// When can't determine, we end up running the normal Equal() to tie-break (due to our differ functions).+func (b *bisyncRun) resyncWinningPathToEqual(winningPath int) bool {+ if b.resyncIs1to2 {+ return winningPath != 1+ }+ return winningPath != 2+}diff --git a/cmd/bisync/testdata/test_all_changed/golden/test.log b/cmd/bisync/testdata/test_all_changed/golden/test.logindex f340d12c2..cb74904c9 100644--- a/cmd/bisync/testdata/test_all_changed/golden/test.log+++ b/cmd/bisync/testdata/test_all_changed/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest change timestamp on all files except RCLONE_TEST[0mdiff --git a/cmd/bisync/testdata/test_backupdir/golden/test.log b/cmd/bisync/testdata/test_backupdir/golden/test.logindex e398af723..cfd85b692 100644--- a/cmd/bisync/testdata/test_backupdir/golden/test.log+++ b/cmd/bisync/testdata/test_backupdir/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest make modifications on both paths[0mdiff --git a/cmd/bisync/testdata/test_basic/golden/test.log b/cmd/bisync/testdata/test_basic/golden/test.logindex d5f63b679..d3086e790 100644--- a/cmd/bisync/testdata/test_basic/golden/test.log+++ b/cmd/bisync/testdata/test_basic/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest place newer files on both paths[0mdiff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.logindex 535042521..36aa3257c 100644--- a/cmd/bisync/testdata/test_changes/golden/test.log+++ b/cmd/bisync/testdata/test_changes/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest make modifications on both paths[0mdiff --git a/cmd/bisync/testdata/test_check_access/golden/test.log b/cmd/bisync/testdata/test_check_access/golden/test.logindex 7b6e19e88..4184a0f30 100644--- a/cmd/bisync/testdata/test_check_access/golden/test.log+++ b/cmd/bisync/testdata/test_check_access/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest 1. see that check-access passes with the initial setup[0m@@ -84,10 +85,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(13) :[0m [34mtest 4. run sync with check-access. should pass.[0m@@ -176,10 +178,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(24) :[0m [34mtest 8. run sync with --check-access. should pass.[0mdiff --git a/cmd/bisync/testdata/test_check_access_filters/golden/test.log b/cmd/bisync/testdata/test_check_access_filters/golden/test.logindex b9724a84f..eeb347438 100644--- a/cmd/bisync/testdata/test_check_access_filters/golden/test.log+++ b/cmd/bisync/testdata/test_check_access_filters/golden/test.log@@ -19,10 +19,11 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Using filters file {workdir/}exclude-other-filtersfile.txtINFO : Storing filters file hash to {workdir/}exclude-other-filtersfile.txt.md5-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(06) :[0m [34mtest EXCLUDE - test filters for check access[0m@@ -133,10 +134,11 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Using filters file {workdir/}include-other-filtersfile.txtINFO : Storing filters file hash to {workdir/}include-other-filtersfile.txt.md5-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(29) :[0m [34mtest INCLUDE - test include/exclude filters for check access[0mdiff --git a/cmd/bisync/testdata/test_check_filename/golden/test.log b/cmd/bisync/testdata/test_check_filename/golden/test.logindex 59728701e..573976ede 100644--- a/cmd/bisync/testdata/test_check_filename/golden/test.log+++ b/cmd/bisync/testdata/test_check_filename/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest 1. see that check-access passes with the initial setup[0m@@ -85,12 +86,13 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1+INFO : Copying Path2 files to Path1INFO : Checking access healthINFO : Found 2 matching ".chk_file" files on both paths-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(14) :[0m [34mtest 4. run sync with check-access. should pass.[0mdiff --git a/cmd/bisync/testdata/test_check_sync/golden/test.log b/cmd/bisync/testdata/test_check_sync/golden/test.logindex 35246882d..46a5f0ffc 100644--- a/cmd/bisync/testdata/test_check_sync/golden/test.log+++ b/cmd/bisync/testdata/test_check_sync/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest 1. run check-sync-only on a clean sync[0m@@ -99,10 +100,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(20) :[0m [34mtest 7. run normal sync with check-sync enabled (default)[0mdiff --git a/cmd/bisync/testdata/test_compare_all/golden/test.log b/cmd/bisync/testdata/test_compare_all/golden/test.logindex 760cb69f6..9f78dbf82 100644--- a/cmd/bisync/testdata/test_compare_all/golden/test.log+++ b/cmd/bisync/testdata/test_compare_all/golden/test.log@@ -13,10 +13,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": true}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest make modifications on both paths[0mdiff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.logindex 06dd5f2c6..096c5f0c5 100644--- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log+++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log@@ -21,10 +21,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(11) :[0m [34mtest 1. Create an empty dir on Path1 by creating subdir/placeholder.txt and then deleting the placeholder[0m@@ -144,10 +145,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(40) :[0m [34mlist-dirs {path1/}[0msubdir/ - filename hash: 86ae37b338459868804e9697025ba4c2diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.logindex 9b5f48d90..0eca08d1c 100644--- a/cmd/bisync/testdata/test_dry_run/golden/test.log+++ b/cmd/bisync/testdata/test_dry_run/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest new on path2 - file10[0m@@ -65,12 +66,12 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0mNOTICE: file10.txt: Skipped copy as --dry-run is set (size 19)NOTICE: file4.txt: Skipped copy as --dry-run is set (size 0)NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19)-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mNOTICE: file1.txt: Skipped copy as --dry-run is set (size 0)NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19)NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13)diff --git a/cmd/bisync/testdata/test_equal/golden/test.log b/cmd/bisync/testdata/test_equal/golden/test.logindex f52018acd..0a7f9ab34 100644--- a/cmd/bisync/testdata/test_equal/golden/test.log+++ b/cmd/bisync/testdata/test_equal/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0mdiff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log b/cmd/bisync/testdata/test_extended_char_paths/golden/test.logindex ede7e1807..463e8e967 100644--- a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log+++ b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log@@ -25,10 +25,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}測試_Русский_ _ _ě_áñ/" vs Path2 "{path2/}測試_Русский_ _ _ě_áñ/"INFO : [32mBisync successful[0m[36m(14) :[0m [34mcopy-listings resync[0m@@ -81,10 +82,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(24) :[0m [34mdelete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file[0m[36m(25) :[0m [34mbisync check-access check-filename=測試_check{spc}file[0m@@ -125,10 +127,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(29) :[0m [34mbisync check-access check-filename=測試_check{spc}file[0mINFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m@@ -169,10 +172,11 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Using filters file {workdir/}測試_filtersfile.txtINFO : Storing filters file hash to {workdir/}測試_filtersfile.txt.md5-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(34) :[0m [34mcopy-as {datadir/}file1.txt {path1/} fileZ.txt[0m[36m(35) :[0m [34mbisync filters-file={workdir/}測試_filtersfile.txt[0mdiff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.logindex 25bf9ea43..eda13848c 100644--- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log+++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log@@ -23,10 +23,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(12) :[0m [34mtest place a newer files on both paths[0mdiff --git a/cmd/bisync/testdata/test_filters/golden/test.log b/cmd/bisync/testdata/test_filters/golden/test.logindex c43a9beb5..9da9b2130 100644--- a/cmd/bisync/testdata/test_filters/golden/test.log+++ b/cmd/bisync/testdata/test_filters/golden/test.log@@ -18,10 +18,11 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Using filters file {workdir/}filtersfile.fltINFO : Storing filters file hash to {workdir/}filtersfile.flt.md5-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(05) :[0m [34mcopy-listings resync[0mdiff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.logindex 5d15dbe36..a60aa5d49 100644--- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log+++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest 1. inject filters file in workdir.[0m@@ -78,10 +79,11 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Using filters file {workdir/}filtersfile.txtINFO : Storing filters file hash to {workdir/}filtersfile.txt.md5-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(12) :[0m [34mtest 5. run with filters-file alone. should run.[0m@@ -142,9 +144,9 @@ INFO : Bisyncing with Comparison Settings:INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"INFO : Using filters file {workdir/}filtersfile.txtINFO : Skipped storing filters file hash to {workdir/}filtersfile.txt.md5 as --dry-run is set-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listingsINFO : [32mBisync successful[0mdiff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.logindex fc6fc4e8f..f54cd7baf 100644--- a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log+++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mbisync resync ignore-listing-checksum[0mINFO : Bisyncing with Comparison Settings:@@ -30,10 +31,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(05) :[0m [34mtest place newer files on both paths[0mdiff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log b/cmd/bisync/testdata/test_max_delete_path1/golden/test.logindex 877b48f0a..42aff09c0 100644--- a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log+++ b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest delete >50% of local files[0mdiff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.logindex d6efc5981..1cc290994 100644--- a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log+++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest delete >50% of remote files[0mdiff --git a/cmd/bisync/testdata/test_normalization/golden/test.log b/cmd/bisync/testdata/test_normalization/golden/test.logindex c8c0f2a6d..5e4cbbccf 100644--- a/cmd/bisync/testdata/test_normalization/golden/test.log+++ b/cmd/bisync/testdata/test_normalization/golden/test.log@@ -15,10 +15,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m@@ -93,10 +94,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m@@ -166,10 +168,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(29) :[0m [34mtest changed on one path[0mdiff --git a/cmd/bisync/testdata/test_rclone_args/golden/test.log b/cmd/bisync/testdata/test_rclone_args/golden/test.logindex 10819ff05..73ede1e69 100644--- a/cmd/bisync/testdata/test_rclone_args/golden/test.log+++ b/cmd/bisync/testdata/test_rclone_args/golden/test.log@@ -13,10 +13,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": true}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest place newer files on both paths[0m@@ -104,10 +105,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(19) :[0m [34mcopy-file {datadir/}file1.txt {path1/}[0m@@ -154,10 +156,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": true}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(25) :[0m [34mcopy-as {datadir/}file21.txt {path2/} file2.txt[0mdiff --git a/cmd/bisync/testdata/test_resolve/golden/test.log b/cmd/bisync/testdata/test_resolve/golden/test.logindex a8e129259..9223c3f6a 100644--- a/cmd/bisync/testdata/test_resolve/golden/test.log+++ b/cmd/bisync/testdata/test_resolve/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m@@ -282,8 +283,8 @@ INFO : Path2: 2 changes: [32m 1 new[0m, [33m 1 modified[0m, [31mINFO : ([33mModified[0m: [36m 1 newer[0m, [34m 0 older[0m, [36m 1 larger[0m, [34m 0 smaller[0m)INFO : Applying changesINFO : Checking potential conflicts...-ERROR : file1.txt: md5 differERROR : file2.txt: md5 differ+ERROR : file1.txt: md5 differNOTICE: {path2String}: 2 differences foundNOTICE: {path2String}: 2 errors while checkingINFO : Finished checking the potential conflicts. 2 differences founddiff --git a/cmd/bisync/testdata/test_resync/golden/test.log b/cmd/bisync/testdata/test_resync/golden/test.logindex 9c7164f85..f9488a672 100644--- a/cmd/bisync/testdata/test_resync/golden/test.log+++ b/cmd/bisync/testdata/test_resync/golden/test.log@@ -15,10 +15,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(05) :[0m [34mmove-listings empty-path1[0m@@ -36,10 +37,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(09) :[0m [34mmove-listings empty-path2[0m@@ -83,10 +85,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(31) :[0m [34mcopy-listings mixed-diffs[0mdiff --git a/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lstnew file mode 100644index 000000000..b0d680388--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst@@ -0,0 +1,4 @@+# bisync listing v1 from test+- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"+- 42 - - 2022-02-22T00:00:00.000000000+0000 "file1.txt"+- 33 - - 2022-02-22T00:00:00.000000000+0000 "file2.txt"diff --git a/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst-newnew file mode 100644index 000000000..4f98654dc--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst-new@@ -0,0 +1 @@+# bisync listing v1 from testdiff --git a/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst-oldnew file mode 100644index 000000000..75d37f056--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path1.lst-old@@ -0,0 +1,4 @@+# bisync listing v1 from test+- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"+- 33 - - 2006-03-04T00:00:00.000000000+0000 "file1.txt"+- 42 - - 2005-01-02T00:00:00.000000000+0000 "file2.txt"diff --git a/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lstnew file mode 100644index 000000000..b0d680388--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst@@ -0,0 +1,4 @@+# bisync listing v1 from test+- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"+- 42 - - 2022-02-22T00:00:00.000000000+0000 "file1.txt"+- 33 - - 2022-02-22T00:00:00.000000000+0000 "file2.txt"diff --git a/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst-newnew file mode 100644index 000000000..4f98654dc--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst-new@@ -0,0 +1 @@+# bisync listing v1 from testdiff --git a/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst-oldnew file mode 100644index 000000000..75d37f056--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/_testdir_path1.._testdir_path2.path2.lst-old@@ -0,0 +1,4 @@+# bisync listing v1 from test+- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST"+- 33 - - 2006-03-04T00:00:00.000000000+0000 "file1.txt"+- 42 - - 2005-01-02T00:00:00.000000000+0000 "file2.txt"diff --git a/cmd/bisync/testdata/test_resync_modes/golden/test.log b/cmd/bisync/testdata/test_resync_modes/golden/test.lognew file mode 100644index 000000000..017822aa2--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/golden/test.log@@ -0,0 +1,192 @@+[36m(01) :[0m [34mtest resync-mode[0m+++[36m(02) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m+[36m(03) :[0m [34mtouch-glob 2001-01-02 {datadir/} file1R.txt[0m+[36m(04) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(05) :[0m [34mtouch-glob 2001-03-04 {datadir/} file1L.txt[0m+[36m(06) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m++[36m(07) :[0m [34mtest bisync run with --resync-mode=newer[0m+[36m(08) :[0m [34mbisync resync resync-mode=newer[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0m++[36m(09) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m+[36m(10) :[0m [34mtouch-glob 2001-07-23 {datadir/} file1R.txt[0m+[36m(11) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(12) :[0m [34mtouch-glob 2001-08-26 {datadir/} file1L.txt[0m+[36m(13) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m++[36m(14) :[0m [34mtest bisync run with --resync-mode=path2[0m+[36m(15) :[0m [34mbisync resync resync-mode=path2[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0m++[36m(16) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m+[36m(17) :[0m [34mtouch-glob 2002-07-23 {datadir/} file1R.txt[0m+[36m(18) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(19) :[0m [34mtouch-glob 2002-08-26 {datadir/} file1L.txt[0m+[36m(20) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m++[36m(21) :[0m [34mtest bisync run with --resync-mode=larger[0m+[36m(22) :[0m [34mbisync resync resync-mode=larger[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : file1.txt: Path2 is larger. Path1: 33, Path2: 42, Difference: 9+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0m++[36m(23) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m+[36m(24) :[0m [34mtouch-glob 2003-07-23 {datadir/} file1R.txt[0m+[36m(25) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(26) :[0m [34mtouch-glob 2003-09-04 {datadir/} file1L.txt[0m+[36m(27) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m++[36m(28) :[0m [34mtest bisync run with --resync-mode=older[0m+[36m(29) :[0m [34mbisync resync resync-mode=older[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : file1.txt: Path2 is older. Path1: 2003-09-03 20:00:00 -0400 EDT, Path2: 2003-07-22 20:00:00 -0400 EDT, Difference: 1032h0m0s+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0m++[36m(30) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m+[36m(31) :[0m [34mtouch-glob 2004-07-23 {datadir/} file1R.txt[0m+[36m(32) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(33) :[0m [34mtouch-glob 2004-07-23 {datadir/} file1L.txt[0m+[36m(34) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m++[36m(35) :[0m [34mtest bisync run with --resync-mode=smaller[0m+[36m(36) :[0m [34mbisync resync resync-mode=smaller[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : file1.txt: Path1 is smaller. Path1: 33, Path2: 42, Difference: 9+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : file1.txt: Path1 is smaller. Path1: 33, Path2: 42, Difference: 9+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0m++[36m(37) :[0m [34mtest changed on both paths and NOT identical - file1 (file1R, file1L)[0m+[36m(38) :[0m [34mtouch-glob 2005-01-02 {datadir/} file1R.txt[0m+[36m(39) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(40) :[0m [34mcopy-as {datadir/}file1R.txt {path1/} file2.txt[0m+[36m(41) :[0m [34mtouch-glob 2006-03-04 {datadir/} file1L.txt[0m+[36m(42) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m+[36m(43) :[0m [34mcopy-as {datadir/}file1L.txt {path2/} file2.txt[0m++[36m(44) :[0m [34mtest bisync run with --resync-mode=path1[0m+[36m(45) :[0m [34mbisync resync resync-mode=path1[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0m++[36m(46) :[0m [34mtest no winner[0m+[36m(47) :[0m [34mtouch-glob 2022-02-22 {datadir/} file1R.txt[0m+[36m(48) :[0m [34mcopy-as {datadir/}file1R.txt {path2/} file1.txt[0m+[36m(49) :[0m [34mcopy-as {datadir/}file1R.txt {path1/} file2.txt[0m+[36m(50) :[0m [34mtouch-glob 2022-02-22 {datadir/} file1L.txt[0m+[36m(51) :[0m [34mcopy-as {datadir/}file1L.txt {path1/} file1.txt[0m+[36m(52) :[0m [34mcopy-as {datadir/}file1L.txt {path2/} file2.txt[0m++[36m(53) :[0m [34mtest bisync run with --resync-mode=newer[0m+[36m(54) :[0m [34mbisync resync resync-mode=newer[0m+INFO : [2mSetting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.[0m+INFO : Bisyncing with Comparison Settings:+{+"Modtime": true,+"Size": true,+"Checksum": false,+"NoSlowHash": false,+"SlowHashSyncOnly": false,+"DownloadHash": false+}+INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0m+INFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"+INFO : [32mBisync successful[0mdiff --git a/cmd/bisync/testdata/test_resync_modes/initial/RCLONE_TEST b/cmd/bisync/testdata/test_resync_modes/initial/RCLONE_TESTnew file mode 100644index 000000000..d8ca97c2a--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/initial/RCLONE_TEST@@ -0,0 +1 @@+This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete.diff --git a/cmd/bisync/testdata/test_resync_modes/initial/file1.txt b/cmd/bisync/testdata/test_resync_modes/initial/file1.txtnew file mode 100644index 000000000..e69de29bbdiff --git a/cmd/bisync/testdata/test_resync_modes/initial/file2.txt b/cmd/bisync/testdata/test_resync_modes/initial/file2.txtnew file mode 100644index 000000000..e69de29bbdiff --git a/cmd/bisync/testdata/test_resync_modes/modfiles/file1L.txt b/cmd/bisync/testdata/test_resync_modes/modfiles/file1L.txtnew file mode 100644index 000000000..6906ccb09--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/modfiles/file1L.txt@@ -0,0 +1 @@+This file is NOT identical to 1Rdiff --git a/cmd/bisync/testdata/test_resync_modes/modfiles/file1R.txt b/cmd/bisync/testdata/test_resync_modes/modfiles/file1R.txtnew file mode 100644index 000000000..1e3eb3f77--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/modfiles/file1R.txt@@ -0,0 +1 @@+This file is NOT identical to 1L (LARGER)diff --git a/cmd/bisync/testdata/test_resync_modes/modfiles/file2.txt b/cmd/bisync/testdata/test_resync_modes/modfiles/file2.txtnew file mode 100644index 000000000..2ee5fc1ee--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/modfiles/file2.txt@@ -0,0 +1 @@+This file is identical on both sidesdiff --git a/cmd/bisync/testdata/test_resync_modes/scenario.txt b/cmd/bisync/testdata/test_resync_modes/scenario.txtnew file mode 100644index 000000000..51ca567fc--- /dev/null+++ b/cmd/bisync/testdata/test_resync_modes/scenario.txt@@ -0,0 +1,70 @@+test resync-mode+# Check conflict-resolution options during resync+# - Changed on Path2 and on Path1, and NOT identical file1 (file1r, file1l)++test changed on both paths and NOT identical - file1 (file1R, file1L)+touch-glob 2001-01-02 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+touch-glob 2001-03-04 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt++test bisync run with --resync-mode=newer+bisync resync resync-mode=newer++test changed on both paths and NOT identical - file1 (file1R, file1L)+touch-glob 2001-07-23 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+touch-glob 2001-08-26 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt++test bisync run with --resync-mode=path2+bisync resync resync-mode=path2++test changed on both paths and NOT identical - file1 (file1R, file1L)+touch-glob 2002-07-23 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+touch-glob 2002-08-26 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt++test bisync run with --resync-mode=larger+bisync resync resync-mode=larger++test changed on both paths and NOT identical - file1 (file1R, file1L)+touch-glob 2003-07-23 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+touch-glob 2003-09-04 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt++test bisync run with --resync-mode=older+bisync resync resync-mode=older++test changed on both paths and NOT identical - file1 (file1R, file1L)+touch-glob 2004-07-23 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+touch-glob 2004-07-23 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt++test bisync run with --resync-mode=smaller+bisync resync resync-mode=smaller++test changed on both paths and NOT identical - file1 (file1R, file1L)+touch-glob 2005-01-02 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+copy-as {datadir/}file1R.txt {path1/} file2.txt+touch-glob 2006-03-04 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt+copy-as {datadir/}file1L.txt {path2/} file2.txt++test bisync run with --resync-mode=path1+bisync resync resync-mode=path1++test no winner+touch-glob 2022-02-22 {datadir/} file1R.txt+copy-as {datadir/}file1R.txt {path2/} file1.txt+copy-as {datadir/}file1R.txt {path1/} file2.txt+touch-glob 2022-02-22 {datadir/} file1L.txt+copy-as {datadir/}file1L.txt {path1/} file1.txt+copy-as {datadir/}file1L.txt {path2/} file2.txt++test bisync run with --resync-mode=newer+bisync resync resync-mode=newer\ No newline at end of filediff --git a/cmd/bisync/testdata/test_rmdirs/golden/test.log b/cmd/bisync/testdata/test_rmdirs/golden/test.logindex b5e47b879..4e6763801 100644--- a/cmd/bisync/testdata/test_rmdirs/golden/test.log+++ b/cmd/bisync/testdata/test_rmdirs/golden/test.log@@ -14,10 +14,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest 1. delete path1 subdir file[0mdiff --git a/cmd/bisync/testdata/test_volatile/golden/test.log b/cmd/bisync/testdata/test_volatile/golden/test.logindex d8af65a78..ab3003a76 100644--- a/cmd/bisync/testdata/test_volatile/golden/test.log+++ b/cmd/bisync/testdata/test_volatile/golden/test.log@@ -13,10 +13,11 @@ INFO : Bisyncing with Comparison Settings:"DownloadHash": false}INFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-INFO : Copying unique Path2 files to Path1-INFO : - [34mPath2[0m [35mResync is copying UNIQUE files to[0m - [36mPath1[0m-INFO : - [36mPath1[0m [35mResync is copying UNIQUE OR DIFFERING files to[0m - [36mPath2[0m+INFO : Copying Path2 files to Path1+INFO : - [34mPath2[0m [35mResync is copying files to[0m - [36mPath1[0m+INFO : - [36mPath1[0m [35mResync is copying files to[0m - [36mPath2[0mINFO : Resync updating listings+INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"INFO : [32mBisync successful[0m[36m(04) :[0m [34mtest changed on both paths - file5 (file5R, file5L)[0mdiff --git a/docs/content/bisync.md b/docs/content/bisync.mdindex a4ac4772c..461ac604f 100644--- a/docs/content/bisync.md+++ b/docs/content/bisync.md@@ -159,10 +159,10 @@ as the last step in the process.### --resyncThis will effectively make both Path1 and Path2 filesystems contain a-matching superset of all files. Path2 files that do not exist in Path1 will+matching superset of all files. By default, Path2 files that do not exist in Path1 willbe copied to Path1, and the process will then copy the Path1 tree to Path2.-The `--resync` sequence is roughly equivalent to:+The `--resync` sequence is roughly equivalent to the following (but see [`--resync-mode`](#resync-mode) for other options):```rclone copy Path2 Path1 --ignore-existing [--create-empty-src-dirs]rclone copy Path1 Path2 [--create-empty-src-dirs]@@ -173,8 +173,8 @@ or bisync will fail. This is required for safety - that bisync can verifythat both paths are valid.When using `--resync`, a newer version of a file on the Path2 filesystem-will be overwritten by the Path1 filesystem version.-(Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).)+will (by default) be overwritten by the Path1 filesystem version.+(Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815), and more symmetrical options can be specified with the [`--resync-mode`](#resync-mode) flag.)Carefully evaluate deltas using [--dry-run](/flags/#non-backend-flags).For a resync run, one of the paths may be empty (no files in the path tree).@@ -186,7 +186,12 @@ For a non-resync run, either path being empty (no files in the tree) fails withThis is a safety check that an unexpected empty path does not result indeleting **everything** in the other path.-**Note:** `--resync` should only be used under three specific (rare) circumstances:+Note that `--resync` implies `--resync-mode path1` unless a different+[`--resync-mode`](#resync-mode) is explicitly specified.+It is not necessary to use both the `--resync` and `--resync-mode` flags --+either one is sufficient without the other.++**Note:** `--resync` (including `--resync-mode`) should only be used under three specific (rare) circumstances:1. It is your _first_ bisync run (between these two paths)2. You've just made changes to your bisync settings (such as editing the contents of your `--filters-file`)3. There was an error on the prior run, and as a result, bisync now requires `--resync` to recover@@ -196,6 +201,84 @@ Therefore, if you included `--resync` for every bisync run, it would never be pothe deleted file would always keep reappearing at the end of every run (because it's being copied from the other side where it still exists).Similarly, renaming a file would always result in a duplicate copy (both old and new name) on both sides.+If you find that frequent interruptions from #3 are an issue, rather than+automatically running `--resync`, the recommended alternative is to use the+[`--resilient`](#resilient), [`--recover`](#recover), and+[`--conflict-resolve`](#conflict-resolve) flags, (along with [Graceful+Shutdown](#graceful-shutdown) mode, when needed) for a very robust+"set-it-and-forget-it" bisync setup that can automatically bounce back from+almost any interruption it might encounter. Consider adding something like the+following:++```+--resilient --recover --max-lock 2m --conflict-resolve newer+```++### --resync-mode CHOICE {#resync-mode}++In the event that a file differs on both sides during a `--resync`,+`--resync-mode` controls which version will overwrite the other. The supported+options are similar to [`--conflict-resolve`](#conflict-resolve). For all of+the following options, the version that is kept is referred to as the "winner",+and the version that is overwritten (deleted) is referred to as the "loser".+The options are named after the "winner":++- `path1` - (the default) - the version from Path1 is unconditionally+considered the winner (regardless of `modtime` and `size`, if any). This can be+useful if one side is more trusted or up-to-date than the other, at the time of+the `--resync`.+- `path2` - same as `path1`, except the path2 version is considered the winner.+- `newer` - the newer file (by `modtime`) is considered the winner, regardless+of which side it came from. This may result in having a mix of some winners+from Path1, and some winners from Path2. (The implementation is analagous to+running `rclone copy --update` in both directions.)+- `older` - same as `newer`, except the older file is considered the winner,+and the newer file is considered the loser.+- `larger` - the larger file (by `size`) is considered the winner (regardless+of `modtime`, if any). This can be a useful option for remotes without+`modtime` support, or with the kinds of files (such as logs) that tend to grow+but not shrink, over time.+- `smaller` - the smaller file (by `size`) is considered the winner (regardless+of `modtime`, if any).++For all of the above options, note the following:+- If either of the underlying remotes lacks support for the chosen method, it+will be ignored and will fall back to the default of `path1`. (For example, if+`--resync-mode newer` is set, but one of the paths uses a remote that doesn't+support `modtime`.)+- If a winner can't be determined because the chosen method's attribute is+missing or equal, it will be ignored, and bisync will instead try to determine+whether the files differ by looking at the other `--compare` methods in effect.+(For example, if `--resync-mode newer` is set, but the Path1 and Path2 modtimes+are identical, bisync will compare the sizes.) If bisync concludes that they+differ, preference is given to whichever is the "source" at that moment. (In+practice, this gives a slight advantage to Path2, as the 2to1 copy comes before+the 1to2 copy.) If the files _do not_ differ, nothing is copied (as both sides+are already correct).+- These options apply only to files that exist on both sides (with the same+name and relative path). Files that exist *only* on one side and not the other+are *always* copied to the other, during `--resync` (this is one of the main+differences between resync and non-resync runs.).+- `--conflict-resolve`, `--conflict-loser`, and `--conflict-suffix` do not+apply during `--resync`, and unlike these flags, nothing is renamed during+`--resync`. When a file differs on both sides during `--resync`, one version+always overwrites the other (much like in `rclone copy`.) (Consider using+[`--backup-dir`](#backup-dir1-and-backup-dir2) to retain a backup of the losing+version.)+- Unlike for `--conflict-resolve`, `--resync-mode none` is not a valid option+(or rather, it will be interpreted as "no resync", unless `--resync` has also+been specified, in which case it will be ignored.)+- Winners and losers are decided at the individual file-level only (there is+not currently an option to pick an entire winning directory atomically,+although the `path1` and `path2` options typically produce a similar result.)+- To maintain backward-compatibility, the `--resync` flag implies+`--resync-mode path1` unless a different `--resync-mode` is explicitly+specified. Similarly, all `--resync-mode` options (except `none`) imply+`--resync`, so it is not necessary to use both the `--resync` and+`--resync-mode` flags simultaneously -- either one is sufficient without the+other.++### --check-accessAccess check files are an additional safety measure against data loss.@@ -1752,6 +1835,7 @@ instead of of `--size-only`, when `check` is not available.* New `--recover` flag allows robust recovery in the event of interruptions, without requiring `--resync`.* A new `--max-lock` setting allows lock files to automatically renew and expire, for better automatic recovery when a run is interrupted.* Bisync now supports auto-resolving sync conflicts and customizing rename behavior with new [`--conflict-resolve`](#conflict-resolve), [`--conflict-loser`](#conflict-loser), and [`--conflict-suffix`](#conflict-suffix) flags.+* A new [`--resync-mode`](#resync-mode) flag allows more control over which version of a file gets kept during a `--resync`.### `v1.64`* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry)