Go Back   The UNIX and Linux Forums > Top Forums > Emergency UNIX and Linux Support !! Help Me!!
Search Forums:



Emergency UNIX and Linux Support !! Help Me!! Post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-14-2010
Registered User
 

Join Date: Jun 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
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 04:17 AM.. Reason: added code tags
Sponsored Links
    #2  
Old 03-15-2010
rdcwayx rdcwayx is offline Forum Advisor  
Use nawk in Solaris
 

Join Date: Jun 2006
Posts: 2,632
Thanks: 43
Thanked 383 Times in 373 Posts
Why not rsync on the home directory directly?


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

Sponsored Links
    #3  
Old 03-15-2010
Registered User
 

Join Date: Jun 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by rdcwayx View Post
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  
Old 03-15-2010
Registered User
 

Join Date: Feb 2010
Location: /root
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Sponsored Links
    #5  
Old 03-15-2010
funksen funksen is offline Forum Advisor  
Registered User
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 607
Thanks: 14
Thanked 18 Times in 18 Posts
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
Sponsored Links
    #6  
Old 03-15-2010
Registered User
 

Join Date: Jun 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by abubacker View Post
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 View Post
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.
Sponsored Links
    #7  
Old 03-15-2010
Registered User
 

Join Date: Feb 2010
Location: /root
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for your explanation Sardare :-)
Sponsored Links
Closed Thread

Tags
rsync

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script Pause Until Rsync Is Done Transferring droppedonjapan Shell Programming and Scripting 4 06-01-2009 03:38 PM
Transferring files between Windows and AIX Pennant Man AIX 7 01-05-2009 09:31 AM
RSYNC issue jagnikam Shell Programming and Scripting 3 03-18-2008 11:30 AM
rsync issue bag of hammers UNIX for Dummies Questions & Answers 2 10-23-2007 05:52 PM
Transferring hidden files with scp matrixmadhan UNIX for Dummies Questions & Answers 13 01-16-2007 03:00 PM



All times are GMT -4. The time now is 11:09 PM.