Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support backup_exec scripts with context #170

Open
roaima opened this issue Jan 26, 2017 · 2 comments
Open

Feature request: support backup_exec scripts with context #170

roaima opened this issue Jan 26, 2017 · 2 comments

Comments

@roaima
Copy link

roaima commented Jan 26, 2017

I've been using backup_exec entries for a while on systems here to drive an rsync script that understands how to copy only files that been modified in the last 3 years.

Unfortunately for my use case, backup_exec scripts are run in $HOME rather than in the snapshot_root, which means I have to pass a load of extra parameters to my script that replicate information already provided to rsnapshot.

I would like to offer a small patch that exports all the simple configuration variables as environment variables ready for such a script to reference. (I considered patching the change directory requirement so that it was specific to the preexec and postexec commands but decided against that because that might break existing scripts.)

Amongst others, the following environment variables are declared for scripts

RSNAPSHOT_cmd_rsync='/usr/bin/rsync'
RSNAPSHOT_cmd_ssh='/usr/bin/ssh'
RSNAPSHOT_rsync_long_args='--delete --delete-excluded --numeric-ids --fake-super --fuzzy --fuzzy --delete-after'
RSNAPSHOT_rsync_short_args='-avzSi'
RSNAPSHOT_snapshot_root='/backup/Rsync/Romania'

rsnapshot.diff.txt

@StefanMoch
Copy link
Contributor

@roaima
The patch looks reasonable. Would you mind sending it as pull request or with git format-patch, so that the authorship information is retained?

For integration I would rather see this being configurable to prevent inadvertently leaking information: either on/off switch for the feature or ignore/unignore patterns for the options. I'll have a look into that.

@roaima
Copy link
Author

roaima commented Mar 6, 2018

Sure. I'll see if I can work out how to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants