Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-14-2009, 04:01 AM   #1
Registered: Mar 2008
Posts: 183

Rep: Reputation: 31
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
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.
Old 04-14-2009, 07:04 AM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

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

/usr/bin/rsync -avr A:src/ B:dest/
or paramatise it if you want?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HI ,I walt to know how to run multiple instance sathish80 Linux - Newbie 3 01-18-2007 01:12 PM
Killing a specific instance of a program created by a script derriva Programming 2 12-27-2006 04:42 AM
to check instance of a script running kushalkoolwal Programming 14 02-23-2006 05:51 PM
Only one instance of bash script... cmfarley19 Programming 7 05-06-2003 01:42 PM
script in same instance Manish Linux - General 2 02-23-2002 12:03 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration