mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 04:10:31 +08:00
b4216648e4
Before this change, bisync could only detect changes based on modtime, and would refuse to run if either path lacked modtime support. This made bisync unavailable for many of rclone's backends. Additionally, bisync did not account for the Fs's precision when comparing modtimes, meaning that they could only be reliably compared within the same side -- not against the opposite side. Size and checksum (even when available) were ignored completely for deltas. After this change, bisync now fully supports comparing based on any combination of size, modtime, and checksum, lifting the prior restriction on backends without modtime support. The comparison logic considers the backend's precision, hash types, and other features as appropriate. The comparison features optionally use a new --compare flag (which takes any combination of size,modtime,checksum) and even supports some combinations not otherwise supported in `sync` (like comparing all three at the same time.) By default (without the --compare flag), bisync inherits the same comparison options as `sync` (that is: size and modtime by default, unless modified with flags such as --checksum or --size-only.) If the --compare flag is set, it will override these defaults. If --compare includes checksum and both remotes support checksums but have no hash types in common with each other, checksums will be considered only for comparisons within the same side (to determine what has changed since the prior sync), but not for comparisons against the opposite side. If one side supports checksums and the other does not, checksums will only be considered on the side that supports them. When comparing with checksum and/or size without modtime, bisync cannot determine whether a file is newer or older -- only whether it is changed or unchanged. (If it is changed on both sides, bisync still does the standard equality-check to avoid declaring a sync conflict unless it absolutely has to.) Also included are some new flags to customize the checksum comparison behavior on backends where hashes are slow or unavailable. --no-slow-hash and --slow-hash-sync-only allow selectively ignoring checksums on backends such as local where they are slow. --download-hash allows computing them by downloading when (and only when) they're otherwise not available. Of course, this option probably won't be practical with large files, but may be a good option for syncing small-but-important files with maximum accuracy (for example, a source code repo on a crypt remote.) An additional advantage over methods like cryptcheck is that the original file is not required for comparison (for example, --download-hash can be used to bisync two different crypt remotes with different passwords.) Additionally, all of the above are now considered during the final --check-sync for much-improved accuracy (before this change, it only compared filenames!) Many other details are explained in the included docs.
8.8 KiB
8.8 KiB
(01) : test extended-filenames
(02) : fix-names {path1/}subdir_with_ࢺ_/
(03) : fix-names {path2/}subdir_with_ࢺ_/
(04) : fix-names {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt
(05) : fix-names {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt
(06) : fix-names {path1/}Русский.txt
(07) : fix-names {path2/}Русский.txt
(08) : fix-names {path1/}file_enconde_mañana_funcionará.txt
(09) : fix-names {path2/}file_enconde_mañana_funcionará.txt
(10) : test initial bisync
(11) : bisync resync
INFO : Setting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.
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 unique Path2 files to Path1
INFO : - Path2 Resync is copying UNIQUE files to - Path1
INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2
INFO : Resync updating listings
INFO : Bisync successful
(12) : test place a newer files on both paths
(13) : touch-glob 2001-01-02 {datadir/} file1.txt
(14) : touch-glob 2001-01-02 {datadir/} file2.txt
(15) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt
(16) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt
(17) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt
(18) : copy-as {datadir/}file1.txt {path2/} Русский.txt
(19) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt
(20) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt
(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt
(22) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt
(23) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt
(24) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt
(25) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe}
(26) : fix-names {path2/}subdir{spc}with{eol}white{spc}space.txt/file2{spc}with{eol}white{spc}space.txt
(27) : test place a new file on both paths
(28) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt
(29) : touch-glob 2001-01-03 {datadir/} file1.txt
(30) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt
(31) : test delete files on both paths
(32) : delete-file {path2/}filename_contains_ࢺ_.txt
(33) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt
(34) : delete-file {path1/}Русский.txt
(35) : test bisync run
(36) : bisync
INFO : Setting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.
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 : Building Path1 and Path2 listings
INFO : Path1 checking for diffs
INFO : - Path1 File was deleted - Русский.txt
INFO : - Path1 File is new - file1_with white space.txt
INFO : - Path1 File is new - filename_contains_ࢺ_p1m.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/file_with_測試_.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/mañana_funcionará.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/test.txt
INFO : Path1: 7 changes: 6 new, 0 modified, 1 deleted
INFO : Path2 checking for diffs
INFO : - Path2 File changed: size (larger), time (newer) - file_enconde_mañana_funcionará.txt
INFO : - Path2 File was deleted - filename_contains_ࢺ_.txt
INFO : - Path2 File was deleted - subdir_with_ࢺ_/filename_contains_ě_.txt
INFO : - Path2 File changed: size (larger), time (newer) - Русский.txt
INFO : - Path2 File is new - New_top_level_mañana_funcionará.txt
INFO : - Path2 File is new - subdir with␊white space.txt/file2 with␊white space.txt
INFO : - Path2 File is new - "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe"
INFO : - Path2 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt
INFO : - Path2 File is new - subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt
INFO : Path2: 9 changes: 5 new, 2 modified, 2 deleted
INFO : (Modified: 2 newer, 0 older, 2 larger, 0 smaller)
INFO : Applying changes
INFO : - Path1 Queue copy to Path2 - {path2/}file1_with white space.txt
INFO : - Path1 Queue copy to Path2 - {path2/}filename_contains_ࢺ_p1m.txt
INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/file_with_測試_.txt
NOTICE: - WARNING New or changed in both paths - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt
NOTICE: - Path1 Renaming Path1 copy - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1
NOTICE: - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1
NOTICE: - Path2 Renaming Path2 copy - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2
NOTICE: - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2
INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/mañana_funcionará.txt
INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/test.txt
INFO : - Path2 Queue copy to Path1 - {path1/}Русский.txt
INFO : - Path2 Queue copy to Path1 - {path1/}New_top_level_mañana_funcionará.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file_enconde_mañana_funcionará.txt
INFO : - Path1 Queue delete - {path1/}filename_contains_ࢺ_.txt
INFO : - Path2 Queue copy to Path1 - {path1/}subdir with␊white space.txt/file2 with␊white space.txt
INFO : - Path2 Queue copy to Path1 - "{path1/}subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe"
INFO : - Path1 Queue delete - {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt
INFO : - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt
INFO : - Path2 Do queued copies to - Path1
INFO : - Path1 Do queued copies to - Path2
INFO : Updating listings
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
INFO : Bisync successful
(02) : fix-names {path1/}subdir_with_ࢺ_/
(03) : fix-names {path2/}subdir_with_ࢺ_/
(04) : fix-names {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt
(05) : fix-names {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt
(06) : fix-names {path1/}Русский.txt
(07) : fix-names {path2/}Русский.txt
(08) : fix-names {path1/}file_enconde_mañana_funcionará.txt
(09) : fix-names {path2/}file_enconde_mañana_funcionará.txt
(10) : test initial bisync
(11) : bisync resync
INFO : Setting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.
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 unique Path2 files to Path1
INFO : - Path2 Resync is copying UNIQUE files to - Path1
INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2
INFO : Resync updating listings
INFO : Bisync successful
(12) : test place a newer files on both paths
(13) : touch-glob 2001-01-02 {datadir/} file1.txt
(14) : touch-glob 2001-01-02 {datadir/} file2.txt
(15) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt
(16) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt
(17) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt
(18) : copy-as {datadir/}file1.txt {path2/} Русский.txt
(19) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt
(20) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt
(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt
(22) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt
(23) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt
(24) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt
(25) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe}
(26) : fix-names {path2/}subdir{spc}with{eol}white{spc}space.txt/file2{spc}with{eol}white{spc}space.txt
(27) : test place a new file on both paths
(28) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt
(29) : touch-glob 2001-01-03 {datadir/} file1.txt
(30) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt
(31) : test delete files on both paths
(32) : delete-file {path2/}filename_contains_ࢺ_.txt
(33) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt
(34) : delete-file {path1/}Русский.txt
(35) : test bisync run
(36) : bisync
INFO : Setting --ignore-listing-checksum as neither --checksum nor --compare checksum are set.
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 : Building Path1 and Path2 listings
INFO : Path1 checking for diffs
INFO : - Path1 File was deleted - Русский.txt
INFO : - Path1 File is new - file1_with white space.txt
INFO : - Path1 File is new - filename_contains_ࢺ_p1m.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/file_with_測試_.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/mañana_funcionará.txt
INFO : - Path1 File is new - subdir_with_ࢺ_/test.txt
INFO : Path1: 7 changes: 6 new, 0 modified, 1 deleted
INFO : Path2 checking for diffs
INFO : - Path2 File changed: size (larger), time (newer) - file_enconde_mañana_funcionará.txt
INFO : - Path2 File was deleted - filename_contains_ࢺ_.txt
INFO : - Path2 File was deleted - subdir_with_ࢺ_/filename_contains_ě_.txt
INFO : - Path2 File changed: size (larger), time (newer) - Русский.txt
INFO : - Path2 File is new - New_top_level_mañana_funcionará.txt
INFO : - Path2 File is new - subdir with␊white space.txt/file2 with␊white space.txt
INFO : - Path2 File is new - "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe"
INFO : - Path2 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt
INFO : - Path2 File is new - subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt
INFO : Path2: 9 changes: 5 new, 2 modified, 2 deleted
INFO : (Modified: 2 newer, 0 older, 2 larger, 0 smaller)
INFO : Applying changes
INFO : - Path1 Queue copy to Path2 - {path2/}file1_with white space.txt
INFO : - Path1 Queue copy to Path2 - {path2/}filename_contains_ࢺ_p1m.txt
INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/file_with_測試_.txt
NOTICE: - WARNING New or changed in both paths - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt
NOTICE: - Path1 Renaming Path1 copy - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1
NOTICE: - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1
NOTICE: - Path2 Renaming Path2 copy - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2
NOTICE: - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2
INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/mañana_funcionará.txt
INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/test.txt
INFO : - Path2 Queue copy to Path1 - {path1/}Русский.txt
INFO : - Path2 Queue copy to Path1 - {path1/}New_top_level_mañana_funcionará.txt
INFO : - Path2 Queue copy to Path1 - {path1/}file_enconde_mañana_funcionará.txt
INFO : - Path1 Queue delete - {path1/}filename_contains_ࢺ_.txt
INFO : - Path2 Queue copy to Path1 - {path1/}subdir with␊white space.txt/file2 with␊white space.txt
INFO : - Path2 Queue copy to Path1 - "{path1/}subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe"
INFO : - Path1 Queue delete - {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt
INFO : - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt
INFO : - Path2 Do queued copies to - Path1
INFO : - Path1 Do queued copies to - Path2
INFO : Updating listings
INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}"
INFO : Bisync successful