If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > dynamic rsync.... (cron?)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-03, 12:40
tcho@ tcho@ is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
dynamic rsync.... (cron?)

Hi,

I am using Debian woody 3.0_r1 on hppa

I have two web servers on apache. One Primary and one secondary. And I have created a cron job that use rsync to update the content of the /var/www/ directory on the secondary web server (so far every night).
Like that I have my two web servers with the same content....

But I dont think its the best... what I d like to do is to run my rsync script each time the /var/www directory of the primary sever is modified...

Anyone got any ideas...
Maybe using the sockets?

Thanks
Francois
..
Reply With Quote
  #2 (permalink)  
Old 09-05-03, 04:14
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
while true; do
newDetails=$(ls -ld theDirectory)
if [ "${newDetails}" != "${oldDetails:-$newDetails}" ]
then
doYourSyncStuff
fi
oldDetails=${newDetails}
sleep 5
done
Reply With Quote
  #3 (permalink)  
Old 09-05-03, 05:13
tcho@ tcho@ is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
Hi,

Thanks for the script....But that means that I have to install ssh or rsh on my two web servers...Cuz I have to copy FROM the server TO the client...

In fact I woyld like the reverse side...
The client to check whether there is any update to do... like that I have nothing to had on my machines and if i add so other web server in my LVS (load balancing the http) i just have to replicate the same script...

its not the easier way....
You might think that I have a twisted mind

But if you have any hints..

Thanks
francois
Reply With Quote
  #4 (permalink)  
Old 12-19-03, 17:36
trochia trochia is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Implementing this "cron" ??

Quote:
Originally posted by Damian Ibbotson
while true; do
newDetails=$(ls -ld theDirectory)
if [ "${newDetails}" != "${oldDetails:-$newDetails}" ]
then
doYourSyncStuff
fi
oldDetails=${newDetails}
sleep 5
done
hello, I have a couple questions regarding this please?... Newbie < fairly to NIX >... and just needing to mirror sites on remote servers..

thank-you, and HELP ANYONE???

jim
Reply With Quote
  #5 (permalink)  
Old 12-19-03, 17:58
trochia trochia is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Implementing this "cron" ??

Quote:
Originally posted by Damian Ibbotson
while true; do
newDetails=$(ls -ld theDirectory)
if [ "${newDetails}" != "${oldDetails:-$newDetails}" ]
then
doYourSyncStuff
fi
oldDetails=${newDetails}
sleep 5
done
hello, I have a couple questions regarding this please?... Newbie < fairly to NIX >... and just needing to mirror sites on remote servers..

thank-you, and HELP ANYONE???

jim
Reply With Quote
  #6 (permalink)  
Old 12-27-03, 03:35
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On