Rsync problems


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Rsync problems
# 1  
Old 07-26-2002
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
thangorn
# 2  
Old 07-26-2002
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
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? Smilie
thangorn
# 4  
Old 10-25-2002
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Need help on rsync

Hi experts, We need copy 5TB data from one server to another (over a 10Gbps link). We plan to use rsync -av remote:/<path /local on destination server but there're few special requirements like: 1. data copy process should run only from 18:00 Hrs to 07:00 every day until copy is completed. Is... (1 Reply)
Discussion started by: magnus29
1 Replies

3. Shell Programming and Scripting

Rsync script and backup problems.

Hello everybody I'm triing since few days to do this. So sorry if my question looks stupide, but i've tried. I have to get picture from a folder (who is updated automaticly and with subfolder) with theirs extensions (i'm ok on that) and this files have to me copied in a folder where a website... (7 Replies)
Discussion started by: boytruc
7 Replies

4. Shell Programming and Scripting

rsync

hi there I wonder if some-one can help. I am trying to use rsync on my mac to transfer a folder to a remote machine. I have logged into rysnc on my mac no problem and I'm trying to execute this command: rsync -a -e ssh /Users/myname/myfolder/sourcefolder/... (3 Replies)
Discussion started by: volterony
3 Replies

5. UNIX for Dummies Questions & Answers

Problems using rsync with cron

Hi, I've created a cron job for a script with a rsync command in it. The script is named pull.sh and contains the following line : What it is supposed to do is pull backup files from the production server of my company to my local server. It should also generate the log file (output.log)... (1 Reply)
Discussion started by: anaigini45
1 Replies

6. UNIX for Dummies Questions & Answers

rsync

i last night i copied a 400GB folder using rsync and ssh i did: rsync -r /mnt/500_GB ssh miguel@192.168.1.3:/mnt/1500_GB and it copied the folder fine all 400GB. The question is: If i put more files to that initial 400GB folder, which command can i run on my server for it to update the... (4 Replies)
Discussion started by: supermiguel
4 Replies

7. UNIX for Dummies Questions & Answers

Problems using rsync in Leopard with SSH... seeking solution/alternative

Precursor: ...it may sound like I'm at least somewhat comfortable with Unix, but I'm far from it. Layman's terms would be greatly appreciated :) Okay, so here's the situation. I created a website using iWeb, and I'm not using a .Mac account (you can sync website in one click if you do). Being... (4 Replies)
Discussion started by: compulsiveguile
4 Replies

8. UNIX for Advanced & Expert Users

Rsync

I have to update my files to 2-4 servers and I tar all the files and ftp to every server. I have heard about Rsync, but are there any other ways that are the same as Rsync?> (1 Reply)
Discussion started by: darknite87
1 Replies

9. UNIX for Dummies Questions & Answers

rsync

I want to do rsync only for the difference in the last 30 days. How do I specify the "30 days" on the command line below? >rsync -avz prj# /rsource /destination Thanks for help (6 Replies)
Discussion started by: wz253
6 Replies
Login or Register to Ask a Question