Description
Synopsis
@Jwink3101 wrote in #5164 (comment)
Filters work well since they are applied to both sides. This means that changing a filter will make the files look like it was deleted on both sides and nothing will happen.
However, the [--exclude-if-present][eifp] filter is very dangerous if the excluded file is added on one side only after files in the directory are in sync. It will cause rclone to skip the directory on one side and appear like it was deleted.
There are safe ways to use --exclude-if-present. For example, you can place exclude file in place on both sides before syncing. (Or placing it without adding the filter, syncing, and then adding the filter). Or, if the files have never been synced before (i.e. it's a new directory with the exclude file) then nothing bad will happen.
This isn't a new problem in bisync from regular rclone though I do see it amplified for it. Again this goes back to the philosophical idea of a sync-config vs CLI flags. The reason I chose not to use the CLI flags was because I wanted it very clear that a "sync job" is not a one-off.
#5164 (comment) (ivandeex)
Nice catch! We have open bug reports (#4523) about this. We have requests (#4753, #4793) to add more non-commutive flags. We try (#4011, #4856) to restrain reasonably. I'd probably make bisync ban this flag or issue a warning or put it under the --force conditional (?).
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsTo do
Activity
Jwink3101 commentedon Oct 8, 2021
There is another option but I deemed it too intrusive for syncrclone: You could note the presence of the exclude-if-present file and apply that filter to the other side.
For syncrclone, I would mean that I continue listing both sides even after finding the exclude. But since you can work internally, you could apply the filter retroactively to the other side to remove those files from contention.
In the end, I settled for raising a warning. I have the benefit of backups being the default so, unless turned off, I could ensure that even if I messed up, I still had the files. Rclone itself hasn't shied away from letting users shoot themselves in the foot though either.