LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 04: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, 07:04 AM   #2
billymayday
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

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


Reply



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
Only one instance of bash script... cmfarley19 Programming 11 01-13-2018 04:41 AM
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
script in same instance Manish Linux - General 2 02-23-2002 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:06 AM.

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
Open Source Consulting | Domain Registration