![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
Have you tried the following:
export RSYNC_RSH="/usr/local/bin/ssh -l $REMOTE_USER" rsyn -va /www/html remotehost:/www |
|
#3
|
|||
|
|||
|
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
|
|||
|
|||
|
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 |