LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 04-14-2009, 05:01 AM   #1
abolishtheun
Member
 
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
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.
 
Old 04-14-2009, 08:04 AM   #2
billymayday
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

Code:
#!/bin/sh
/path/versioning
/usr/bin/rsync -avr A:src/ B:dest/
or paramatise it if you want?
 
  


Reply


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 02:12 PM
Killing a specific instance of a program created by a script derriva Programming 2 12-27-2006 05:42 AM
to check instance of a script running kushalkoolwal Programming 14 02-23-2006 06:51 PM
Only one instance of bash script... cmfarley19 Programming 7 05-06-2003 02:42 PM
script in same instance Manish Linux - General 2 02-23-2002 01:03 PM


All times are GMT -5. The time now is 06:54 PM.

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