rclone/docs/content
nielash 4025f42bd9 bisync: Graceful Shutdown, --recover from interruptions without --resync - fixes #7470
Before this change, bisync had no mechanism to gracefully cancel a sync early
and exit in a clean state. Additionally, there was no way to recover on the
next run -- any interruption at all would cause bisync to require a --resync,
which made  bisync more difficult to use as a scheduled background process.

This change introduces a "Graceful Shutdown" mode and --recover flag to
robustly recover from even un-graceful shutdowns.

If --recover is set, in the event of a sudden interruption or other un-graceful
shutdown, bisync will attempt to automatically recover on the next run, instead
of requiring --resync. Bisync is able to recover robustly by keeping one
"backup" listing at all times, representing the state of both paths after the
last known successful sync. Bisync can then compare the current state with this
snapshot to determine which changes it needs to retry. Changes that were synced
after this snapshot (during the run that was later interrupted) will appear to
bisync as if they are "new or changed on both sides", but in most cases this is
not a problem, as bisync will simply do its usual "equality check" and learn
that no action needs to be taken on these files, since they are already
identical on both sides.

In the rare event that a file is synced successfully during a run that later
aborts, and then that same file changes AGAIN before the next run, bisync will
think it is a sync conflict, and handle it accordingly. (From bisync's
perspective, the file has changed on both sides since the last trusted sync,
and the files on either side are not currently identical.) Therefore, --recover
carries with it a slightly increased chance of having conflicts -- though in
practice this is pretty rare, as the conditions required to cause it are quite
specific. This risk can be reduced by using bisync's "Graceful Shutdown" mode
(triggered by sending SIGINT or Ctrl+C), when you have the choice, instead of
forcing a sudden termination.

--recover and --resilient are similar, but distinct -- the main difference is
that --resilient is about _retrying_, while --recover is about _recovering_.
Most users will probably want both. --resilient allows retrying when bisync has
chosen to abort itself due to safety features such as failing --check-access or
detecting a filter change. --resilient does not cover external interruptions
such as a user shutting down their computer in the middle of a sync -- that is
what --recover is for.

"Graceful Shutdown" mode is activated by sending SIGINT or pressing Ctrl+C
during a run. Once triggered, bisync will use best efforts to exit cleanly
before the timer runs out. If bisync is in the middle of transferring files, it
will attempt to cleanly empty its queue by finishing what it has started but
not taking more. If it cannot do so within 30 seconds, it will cancel the
in-progress transfers at that point and then give itself a maximum of 60
seconds to wrap up, save its state for next time, and exit. With the -vP flags
you will see constant status updates and a final confirmation of whether or not
the graceful shutdown was successful.

At any point during the "Graceful Shutdown" sequence, a second SIGINT or Ctrl+C
will trigger an immediate, un-graceful exit, which will leave things in a
messier state. Usually a robust recovery will still be possible if using
--recover mode, otherwise you will need to do a --resync.

If you plan to use Graceful Shutdown mode, it is recommended to use --resilient
and --recover, and it is important to NOT use --inplace, otherwise you risk
leaving partially-written files on one side, which may be confused for real
files on the next run. Note also that in the event of an abrupt interruption, a
lock file will be left behind to block concurrent runs. You will need to delete
it before you can proceed with the next run (or wait for it to expire on its
own, if using --max-lock.)
2024-01-20 16:31:28 -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: Graceful Shutdown, --recover from interruptions without --resync - fixes #7470 2024-01-20 16:31:28 -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