Bug 10405 - Feature request: Add support for pre/post cmds for the rsync client
Feature request: Add support for pre/post cmds for the rsync client
Status: NEW
Product: rsync
Classification: Unclassified
Component: core
3.1.1
All All
: P5 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-29 21:50 UTC by Christian Ruppert
Modified: 2014-08-07 19:17 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Ruppert 2014-01-29 21:50:44 UTC
Hi,

it would be really useful to have some kind of --pre-cmd/--post-cmd and esp. more advanced like --post-cmd-fail, --post-cmd-success.
rsync should then execute the passed scripts and (add a command for it as well?) it should also pass the list of transfered (all), failed or successfully transfered files/dirs.
A control option for it could e.g. look like --cmd-pass=[0|1|2|3] where:
0 = disabled, nothing passed at all
1 = only successfully transfered objects
2 = only failed
3 = any

That would make rsync almost perfect and one could easily take care of different situations without having to parse the complete output of rsync. It shouldn't be that difficult actually, esp. basic pre/post cmds.

I'd perhaps even try to write a patch that adds the mentioned features (in case I get to it).
Comment 1 Kevin Korb 2014-01-29 21:57:03 UTC
Personally, I wouldn't have any use for the processing of the output part but a pre and post command to create and destroy lvm2 snapshots would be useful.  Especially in keeping rsync from attempting to backup an empty mountpoint if the snapshot fails.

Yes, this can be handled in a script but it would be easier if rsync handled it internally especially if using a restricted ssh key for access to the system being backed up.
Comment 2 roland 2014-08-06 21:45:38 UTC
regarding restricted ssh - wouldn`t that be a security nightmare if rsync could exec any additional command ?
Comment 3 Christian Ruppert 2014-08-07 19:17:22 UTC
(In reply to comment #2)
> regarding restricted ssh - wouldn`t that be a security nightmare if rsync could
> exec any additional command ?

At least my idea is meant to be client side only.