Allow rsync command to be manually specified #90
+249
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have encountered the need to run linux-timemachine explicitly with a custom rsync executable instead of
/usr/bin/rsync
. (Specifically, my desire is to invoke the officersync-no-vanished
wrapper script from the rsync distribution to prevent my backups failing when files are deleted while the backup is in progress.)As the
PATH
variable used by thetimemachine
script is now explicitly baked in (as of #66 (comment)), I can't accomplish this this by placing my custom rsync script elsewhere in myPATH
. No quibble with the valid security concerns that led to baking in thePATH
value, but it means this problem requires a different solution.This PR adds the ability to specify an alternate
rsync
command by setting theRSYNC_COMMAND
environment variable when invokingtimemachine
. This value may be a simple command name that will be resolved as normal from the configuredPATH
, or it may be an absolute or relative path to a specific executable anywhere in the filesystem.