linux-timemachine icon indicating copy to clipboard operation
linux-timemachine copied to clipboard

Adding paths to the rysnc options will cause unexpected issues

Open book opened this issue 1 month ago • 1 comments

I understand that timemachine expects only two arguments before the ---separated rsync options.

timemachine passes those "rsync options" after the -- as a whole to rsync. This means that if those arguments contain one or more paths that rsync will accept, it will completely change the meaning of the generated rsync command-line, leading to unexpected behavior.

I don't think there's a way around this, apart from actually parsing the rsync options... 😱 (If only because they can be in either --option=value or --option value forms, forcing the tool to know them in accurate detail.)

book avatar Nov 17 '25 11:11 book

Also, rsync actually accepts being given multiple SRC, but only ever a single DEST, meaning that it would be possible to run:

timemachine SRC1 SRC2 DEST -- [rsync opts]

rsync ensures that the sources are consistent (all local or all remote).
(rsync also supports being given a single SRC path and not DEST, but let's ignore that for the moment.)

And I just found out that there's a PR for this already: #92.

book avatar Nov 17 '25 11:11 book