[CentOS] rsync arg list to long

Thu Aug 30 16:41:43 UTC 2007
Les Mikesell <lesmikesell at gmail.com>

Jerry Geis wrote:

>>> / I am trying to do an rsync or scp from machine1 to machine2.
> />>/ I am getting arg list to long.
> />>/
> />>/ I am using centos 5 machine 1 and centos 4.5 on machine2.
> />>/
> />>/ I am using the default shell which is bash.
> />>/
> />>/ How can I get past this?
> /
>> Change your rsync command around a bit.
> 
>> (If you can show us the command you're using, we can make some 
>> suggestions)
> 
>> I would gather that you have a huge amount of files in the dir you're 
>> syncing.
> 
> 
> I was trying to do "rsync -a root at machine2:/somedirectory ."
> 
> There are multiple directories under the tree and yes many files.
> 
> also tried "scp -r root at machine2:/somedirectory ." with the same result 
> of too many files.

Are you sure that was the exact command?  Rsync can handle a huge number 
of files internally, although it does require a certain amount of memory 
for each filename in the tree during the transfer.  You should only see 
that 'arg list too long' error if you let the shell expand a wildcard 
like * in a directory containing many files.

I usually prefer to go the source machine/directory and give the command 
like "rsync -a . somemachine:/somedirectory", though.

-- 
    Les Mikesell
     lesmikesell at gmail.com