Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rsync command help

Status
Not open for further replies.

Pankaj2

Programmer
Jul 29, 2008
4
IS
Hello,

I am using rsync command to connect remote Server (UNIX) and copy jar files to local server (UNIX). As far as I know rsync command is fastet way to transfer the files from remote server to local server.

Rsync command seems to be working fine till now. However recently new directories were added on remote Server which include jars,wars have been added but rsync command is not taking those NEW directories and still continue to copy the files of existing directory only.

I am using rsync -avz user@remote_server:/remote local

Any suggestion what might be the problem?

Regards
Pankaj
 
Are the new directories subdirectories of /remote on the remote server?

Annihilannic.
 
Permissions perhaps? Are they owned by a different user to the existing directories, or do they have different permissions applied?

Does rsync report any error messages at all, or does it just behave as those directories don't even exist?

Annihilannic.
 
Hello Annihilannic,

New directories are under same user and permission. Rsync command behave as if these NEW directory don't even exist and skip them and i hardly see any error message.

Personally I feel that we should be some option available for rsync which should take not only existing directory but also new directory.

If possible can you provide any valid information.

Regards
Pankaj

 
Look at the options for rsync. Maybe add the "[tt]-r[/tt]" or "[tt]--recursive[/tt]" option.

Also, if you have a trailing slash on the remote directory specification, it changes the way it handles the contents of a directory. This from the man page...
A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred to the containing directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:

rsync -av /src/foo /dest
rsync -av /src/foo/ /dest/foo

See for more info.
 
-a includes -r, so that shouldn't be necessary. My testing with -avz seems to copy any new directories I create in the source location... so I can't think why it's not working for Pankaj2. What versions of rsync and on what platforms (source and destination)?

Annihilannic.
 
Hi,

I am using 2.6.8 version of rsync and both platforms are Linux flavor only (SOURCE is RHEL and DESTINATION is CENTOS)

Thanks
Pankaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top