rsync should stop transferring the active file upon press of a specific key.
There is already extensive file exclusion functionality, but the ability to skip the current file (the one visible when using --progress) would be really quite handy to have.
A hack is to save the file on the backedu up host, and overwrite the inode, e.g. "echo > file". This will then cause BackupPC to move on and log an error.
But indeed, having the information about
- which file is being processed
- some metadata, e.g. size
- when processing started
available in the web interface would be great. Ideally, this would then be augmented with the ability to cancel/skip this file and optionally to add the file or the containing directory to the global or host exclude list.
(the hack is courtesy of Ronny Aasen)
that would be a quite useful feature.
i`d recommend that this feature should be activated with a commandline option for safety purpose. and skipping should then be repeated while the key is pressed down, so one could skip multiple files at once or an entire directory structure (e.g. when accidentally syncing /proc etc)
If this ever gets implemented: instead of (interactively) pressing a key to interrupt the current transfer of a particular object, I'd like it to also react to a signal (e.g. SIGUSR1) that can be sent to rsync, even when it's not started interactively.
There's no good way to implement something like that in the current rsync.
The "echo > sourcefile" workaround seems to not trigger an error, at least not straight away and at least on XFS, but instead speeds up the operation and stops writing more data to the target file. Observation (both source and target filesystems are local, 5.7 TB file at 68% at time of intervention):
* Before "echo > sourcefile", rsync -P reported about 200MB/s
* After "echo > sourcefile", rsync -P reports about 650MB/s and the target file's mtime and size no longer change
* At 100%, rsync says "read errors mapping "redacted": No data available (61)
WARNING: redacted failed verification -- update discarded (will try again)." and then syncs the 1-byte file created with `echo`.
Still grateful @martin for sharing the idea. I found this searching for a way to inject an I/O error.
For the source file backup, `cp --reflink=always` is your friend.