rclone/docs/content
nielash 810644e873 bisync: add --resync-mode for customizing --resync - fixes #5681
Before this change, the path1 version of a file always prevailed during
--resync, and many users requested options to automatically select the winner
based on characteristics such as newer, older, larger, and smaller. This change
adds support for such options.

Note that ideally this feature would have been implemented by allowing the
existing `--resync` flag to optionally accept string values such as `--resync
newer`. However, this would have been a breaking change, as the existing flag
is a `bool` and it does not seem to be possible to have a `string` flag that
accepts both `--resync newer` and `--resync` (with no argument.) (`NoOptDefVal`
does not work for this, as it would force an `=` like `--resync=newer`.) So
instead, the best compromise to avoid a breaking change was to add a new
`--resync-mode CHOICE` flag that implies `--resync`, while maintaining the
existing behavior of `--resync` (which implies `--resync-mode path1`. i.e. both
flags are now valid, and either can be used without the other.

--resync-mode CHOICE

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`. 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` 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.
2024-01-20 17:17:01 -05:00
..
commands sync: report list of synced paths to file -- see #7282 2024-01-20 14:50:08 -05:00
oracleobjectstorage docs: fix typos found by codespell in docs and code comments 2023-09-23 12:20:01 +01:00
_index.md docs: add bisync to index 2024-01-20 14:50:08 -05:00
alias.md docs: Add minimum versions to all the backend pages and some of the other pages 2022-11-18 14:41:24 +00:00
amazonclouddrive.md amazonclouddrive: remove Amazon Drive backend code and docs #7539 2024-01-04 17:05:54 +00:00
authors.md Add Harshit Budhraja to contributors 2024-01-17 10:23:50 +00:00
azureblob.md Version v1.65.0 2023-11-26 16:07:39 +00:00
azurefiles.md azurefiles: finish docs and implementation and add optional interfaces 2023-11-18 16:48:23 +00:00
b2.md Version v1.65.0 2023-11-26 16:07:39 +00:00
bisync.md bisync: add --resync-mode for customizing --resync - fixes #5681 2024-01-20 17:17:01 -05:00
box.md Version v1.65.0 2023-11-26 16:07:39 +00:00
bugs.md docs: improve grammar and fix typos (#5361) 2021-11-04 12:50:43 +01:00
cache.md docs: add badge for experimental/beta/deprecated status next to version in backend docs 2022-12-03 18:58:55 +01:00
changelog.md Changelog updates from Version v1.65.1 2024-01-08 11:54:02 +00:00
chunker.md docs: cleanup backend hashes sections 2023-11-20 17:43:57 +00:00
combine.md docs: show only significant parts of version number in version introduced label 2022-12-21 12:41:47 +00:00
compress.md docs: show only significant parts of version number in version introduced label 2022-12-21 12:41:47 +00:00
contact.md docs: update contact page on website 2023-07-05 16:57:07 +01:00
crypt.md amazonclouddrive: remove Amazon Drive backend code and docs #7539 2024-01-04 17:05:54 +00:00
docker.md docs: show only significant parts of version number in version introduced label 2022-12-21 12:41:47 +00:00
docs.md sync: --fix-case flag to rename case insensitive dest - fixes #4854 2024-01-20 14:50:08 -05:00
downloads.md docs: add rclone OS requirements 2024-01-17 16:42:33 +00:00
drive.md Version v1.65.0 2023-11-26 16:07:39 +00:00
dropbox.md Version v1.65.0 2023-11-26 16:07:39 +00:00
faq.md docs: faq: add solution for port opening issues on Windows 2023-06-25 11:20:54 +01:00
fichier.md Version v1.65.0 2023-11-26 16:07:39 +00:00
filefabric.md Version v1.65.0 2023-11-26 16:07:39 +00:00
filtering.md add missing backtick 2024-01-19 11:17:36 +00:00
flags.md Version v1.65.0 2023-11-26 16:07:39 +00:00
ftp.md Version v1.65.0 2023-11-26 16:07:39 +00:00
googlecloudstorage.md Version v1.65.0 2023-11-26 16:07:39 +00:00
googlephotos.md Version v1.65.0 2023-11-26 16:07:39 +00:00
gui.md docs: show only significant parts of version number in version introduced label 2022-12-21 12:41:47 +00:00
hasher.md docs: fix typos found by codespell 2023-03-24 20:49:00 +00:00
hdfs.md Version v1.65.0 2023-11-26 16:07:39 +00:00
hidrive.md Version v1.65.0 2023-11-26 16:07:39 +00:00
http.md Version v1.65.0 2023-11-26 16:07:39 +00:00
imagekit.md Version v1.65.0 2023-11-26 16:07:39 +00:00
install.md docs: document how to build with version info and icon resources on windows 2023-11-01 12:44:04 +01:00
install.sh install.sh: fix harmless error message on install 2023-11-28 19:10:04 +00:00
internetarchive.md Version v1.65.0 2023-11-26 16:07:39 +00:00
jottacloud.md Version v1.65.0 2023-11-26 16:07:39 +00:00
KEYS docs: document release signing and verification 2023-09-11 12:28:23 +01:00
koofr.md Version v1.65.0 2023-11-26 16:07:39 +00:00
licence.md docs: fix typo in license webpage 2022-07-06 11:25:31 +01:00
linkbox.md backend: add Linkbox backend 2023-11-18 17:14:45 +00:00
local.md Version v1.65.0 2023-11-26 16:07:39 +00:00
mailru.md Version v1.65.0 2023-11-26 16:07:39 +00:00
mega.md Version v1.65.0 2023-11-26 16:07:39 +00:00
memory.md docs: cleanup backend hashes sections 2023-11-20 17:43:57 +00:00
netstorage.md docs: show only significant parts of version number in version introduced label 2022-12-21 12:41:47 +00:00
onedrive.md Version v1.65.0 2023-11-26 16:07:39 +00:00
opendrive.md Version v1.65.0 2023-11-26 16:07:39 +00:00
oracleobjectstorage.md oracleobjectstorage: Support "backend restore" command - fixes #7371 2024-01-09 09:43:36 +00:00
overview.md imagekit: updated overview - supported operations 2024-01-17 16:38:54 +00:00
pcloud.md Version v1.65.0 2023-11-26 16:07:39 +00:00
pikpak.md Version v1.65.0 2023-11-26 16:07:39 +00:00
premiumizeme.md Version v1.65.0 2023-11-26 16:07:39 +00:00
privacy.md docs: improve grammar and fix typos (#5361) 2021-11-04 12:50:43 +01:00
protondrive.md Version v1.65.0 2023-11-26 16:07:39 +00:00
putio.md Version v1.65.0 2023-11-26 16:07:39 +00:00
qingstor.md Version v1.65.0 2023-11-26 16:07:39 +00:00
quatrix.md Version v1.65.0 2023-11-26 16:07:39 +00:00
rc.md Version v1.65.0 2023-11-26 16:07:39 +00:00
release_signing.md docs: document release signing and verification 2023-09-11 12:28:23 +01:00
remote_setup.md amazonclouddrive: remove Amazon Drive backend code and docs #7539 2024-01-04 17:05:54 +00:00
s3.md amazonclouddrive: remove Amazon Drive backend code and docs #7539 2024-01-04 17:05:54 +00:00
seafile.md Version v1.65.0 2023-11-26 16:07:39 +00:00
sftp.md Version v1.65.0 2023-11-26 16:07:39 +00:00
sharefile.md Version v1.65.0 2023-11-26 16:07:39 +00:00
sia.md Version v1.65.0 2023-11-26 16:07:39 +00:00
smb.md Version v1.65.0 2023-11-26 16:07:39 +00:00
sponsor.md docs: rename donate page to sponsor page and rework 2023-06-30 14:32:53 +01:00
storj.md storj: update satellite urls and labels 2023-02-06 13:18:15 +00:00
sugarsync.md Version v1.65.0 2023-11-26 16:07:39 +00:00
swift.md Version v1.65.0 2023-11-26 16:07:39 +00:00
tardigrade.md docs: show only significant parts of version number in version introduced label 2022-12-21 12:41:47 +00:00
union.md union: fix documentation 2023-10-21 10:37:43 +01:00
uptobox.md Version v1.65.0 2023-11-26 16:07:39 +00:00
webdav.md Version v1.65.0 2023-11-26 16:07:39 +00:00
yandex.md Version v1.65.0 2023-11-26 16:07:39 +00:00
zoho.md Version v1.65.0 2023-11-26 16:07:39 +00:00