LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   rsync: getting a script to run before/after every instance? (https://www.linuxquestions.org/questions/linux-general-1/rsync-getting-a-script-to-run-before-after-every-instance-718962/)

abolishtheun 04-14-2009 04:01 AM

rsync: getting a script to run before/after every instance?
 
Is it possible to get a script to run every time rsync runs? For example, when I do
Code:

rsync -avr A:src/ B:dest/
I want a script to run before (or after) the syncing on B. I want to do this so that I can implement some sort of versioning on B, so that on every rsync I can make a timestamped copy of any files that change.

billymayday 04-14-2009 07:04 AM

Why can't you just write a batch file that calls the versioning then rsync, so something like

Code:

#!/bin/sh
/path/versioning
/usr/bin/rsync -avr A:src/ B:dest/

or paramatise it if you want?


All times are GMT -5. The time now is 12:56 AM.