Visit The New, Modern Unix Linux Community


rsync transferring multiple files issue


 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support rsync transferring multiple files issue
# 1  
rsync transferring multiple files issue

Hi,

I want to specify multiple remote directories but want to transfer them in a single command with one connection with remote server. This avoids entering passwords repeatedly and is also efficient.

e.g.

rsync -vrt --size-only --delete user@host:/home/user1/dir1 user@host:/home/user1/dir2 user@host:/home/user1/dir3 .... local_dir/

I want to transfer dir1, dir2 and dir3 using the same connection. The above command will establish 3 connections. Is there way to achieve this?
Code:
rsync -vrt --size-only --delete user@host:/home/user1/dir1,/home/user1/dir2,/home/user1/dir3  local_dir/

thanks,
Sam

Last edited by Yogesh Sawant; 12-10-2010 at 05:17 AM.. Reason: added code tags
# 2  
Why not rsync on the home directory directly?

Code:
rsync -vrt --size-only --delete user@host:/home/user1

# 3  
Quote:
Originally Posted by rdcwayx
Why not rsync on the home directory directly?

Code:
rsync -vrt --size-only --delete user@host:/home/user1

because I need to sync specific directories dir1, dir2.. under user1/.
# 4  
why dont you prefer scp command !

---------- Post updated at 06:05 AM ---------- Previous update was at 06:02 AM ----------

Asking for that sake of curiosity , is there any special reason for choosing rsync , please
tell me that if any!
# 5  
If you push the files from remote server, you just need one connection


ssh remote server
Quote:
rsync -vrt --size-only --delete /home/user1/dir1 /home/user1/dir2 /home/user1/dir3 .... user@targetserver1:/dir

I'm not sure if the --delete option will work in this case
# 6  
Quote:
Originally Posted by abubacker
why dont you prefer scp command !

---------- Post updated at 06:05 AM ---------- Previous update was at 06:02 AM ----------

Asking for that sake of curiosity , is there any special reason for choosing rsync , please
tell me that if any!
rsync has significant advantages over scp. What if each directory is 5 GB and the changes since last time you updated were only 1 KB ?

---------- Post updated at 03:34 PM ---------- Previous update was at 03:34 PM ----------

Quote:
Originally Posted by funksen
If you push the files from remote server, you just need one connection


ssh remote server



I'm not sure if the --delete option will work in this case
No I don't want to ssh to remote server. This will not work.
# 7  
Thanks for your explanation Sardare :-)

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #952
Difficulty: Medium
The Creeper virus was first detected on ARPANET in the early 1960s.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy local files to single remote host but multiple folders using rsync

I'm trying to copy a file myfile.scr from my local Linux server to multiple folders on remote AiX server using single rsync command. Below command helps me copy the file "myfile.scr" from my localhost to a remote host folder "/app/deployment/tmpfiles" rsync --delay-updates -F --compress... (1 Reply)
Discussion started by: mohtashims
1 Replies

2. UNIX for Beginners Questions & Answers

Issue with search and replacing multiple items in multiple files

Im having an issue when trying to replace the first column with a new set of values in multiple files. The results from the following code only replaces the files with the last set of values in val.txt. I want to replace all the files with all the values. for date in {1..31} do for val in... (1 Reply)
Discussion started by: ncwxpanther
1 Replies

3. Shell Programming and Scripting

Transferring files to directories

I have a large number of files with file names of the format iv.epoz.hhe.d.2018.028.000000.sac iv.epoz.hhn.d.2018.028.000000.sac iv.epoz.hhz.d.2018.028.000000.sac iv.epoz.hhe.d.2018.029.000000.sac iv.epoz.hhn.d.2018.029.000000.sac iv.epoz.hhz.d.2018.029.000000.sac... (4 Replies)
Discussion started by: kristinu
4 Replies

4. Shell Programming and Scripting

How can we overcome Broken pipe error during scp,SFTP,Rsync while transferring big files.?

Hello All, Hope all are doing well. We use scp (some times sftp and rsync also) for transferring big files (around 2GB each ) from 1 Network to another Network. The Issues which we face :- During transfer some times( Once in 1 week (or twice)) , the speed of transfer gets down to 30 kb/s,... (2 Replies)
Discussion started by: Upendra Bhushan
2 Replies

5. Shell Programming and Scripting

ISSUE in handling multiple same name files :-(

Dear all, My work is completely stuck cos of the following issue. Please find it here and kindly help me. Task is following: I have set of files with such pattern 1t-rw-rw-r-- 1 emily emily 119 Jun 11 10:45 vgtree_5_1_pfs.root 3t-rw-rw-r-- 1 emily emily 145 Jun 11 10:46 vgtree_5_3_pfs.root... (4 Replies)
Discussion started by: emily
4 Replies

6. Shell Programming and Scripting

Script for transferring files

Hi Guys, I have to transfer a few files in my system . The commands to be used are as follows . Will it be possible to send the output of the following in the form of a mail . cd /export/home/teja ls -lrt Quote.java* mv Quote.java Quote.java.20121023 cp /tmp/Quote.java . ls -lrt... (2 Replies)
Discussion started by: Ravi_Teja
2 Replies

7. Shell Programming and Scripting

scp or rsync multiple files in parallel from a remote host

Hi. I'm trying to speed up an rsync command by running it in parallel. There's no real option for this other than if the files are in multiple directories (which they're not). And even then there's no way of knowing if rsync has succeeded as the process is running in the background .. and... (4 Replies)
Discussion started by: Big_Jeffrey
4 Replies

8. UNIX for Dummies Questions & Answers

Mget issue: not transferring more than 2 files

I am trying to transfer about 3000 files from a window platfrom to my linux server. the scrip is pretty simple ftp to the source server (windows) cd to source directory lcd to destination directory mget *.jpg what I get in the log file is: mget 07421001.jpg? 200 PORT command successful.... (4 Replies)
Discussion started by: Doveman
4 Replies

9. Shell Programming and Scripting

Script Pause Until Rsync Is Done Transferring

Alright, I have this script that pulls files from a few locations, process those files, creates a zip file, rsync's it and then removes everything. The problem that I'm having is that I do not know how large the rsync'ed zip file is going to be. Right now I'm using a sleep command before I... (4 Replies)
Discussion started by: droppedonjapan
4 Replies

10. UNIX for Dummies Questions & Answers

Transferring hidden files with scp

Is there a way to scp hidden files only ( with regex ) without specifying the name of the hidden files ? Many thanks in advance ! :) (13 Replies)
Discussion started by: matrixmadhan
13 Replies

Featured Tech Videos