The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
rsync vs cp jsy UNIX for Dummies Questions & Answers 1 03-24-2008 01:51 PM
Problems using rsync in Leopard with SSH... seeking solution/alternative compulsiveguile UNIX for Dummies Questions & Answers 4 12-29-2007 10:10 PM
rsync in ftp Euler04 Shell Programming and Scripting 5 10-24-2005 04:17 AM
Rsync darknite87 UNIX for Advanced & Expert Users 1 06-06-2002 12:37 PM
rsync wz253 UNIX for Dummies Questions & Answers 6 09-04-2001 03:44 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-26-2002
thangorn
Guest
 

Posts: n/a
Rsync problems

Hi

Im trying to syncronise 4 webserver mirrors, using the rsync command. /www/html is the html documents directory.

i am using


export RSYNC_RSH="/usr/local/bin/ssh -l $REMOTE_USER"
rsyn -va /www/html remotehost:/www/html

when this is run, it copies the html file over to the remote server using ssh as expected. but it creates a second html directory. eg
/www/html/html. and places the html files in there

any ideas why this is happening and not putting the html files in /www/html.


thanks

Stu
Forum Sponsor
  #2  
Old 07-26-2002
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Have you tried the following:

export RSYNC_RSH="/usr/local/bin/ssh -l $REMOTE_USER"
rsyn -va /www/html remotehost:/www
  #3  
Old 07-26-2002
thangorn
Guest
 

Posts: n/a
Hi

no havent tried that, Its a bit more complicated actualy. its a script that reads a list of directorys from a text file and loops through them all, and gets a $source_file which is also the destination variable.
so the command is actualy

rsync -va $source_file $remote_host@$source_file

if i echo this line i get

rsyn -va /www/html webserver1:/www/html

my question really, is the above syntax correct?

to try what you suggest i would need to do something like

$source_file == $dest_path

and then strip the last directory off the $dest_path

hhmm anyone know how to do that?
  #4  
Old 10-25-2002
Registered User
 

Join Date: Jan 2002
Location: london
Posts: 2
If you are using a korn shell script you could do the following

#!/bin/ksh -f

source_file="/www/html"

dest_path=${source_file%/*}

echo "source file = " $source_file
echo "dest_path = " $dest_path

which will give you:
source file = /www/html
dest_path = /www
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0