rsync more than 131072 files on linux

Eberhard Moenkeberg emoenke at gwdg.de
Sat Jan 26 05:04:04 GMT 2008


Hi,

On Fri, 25 Jan 2008, Matt McCutchen wrote:
> On Sat, 2008-01-26 at 05:36 +0100, Eberhard Moenkeberg wrote:
> > On Fri, 25 Jan 2008, Mike Frysinger wrote:
> > > On Friday 25 January 2008, Eberhard Moenkeberg wrote:
> > > > On Fri, 25 Jan 2008, Sylvain Gargasson wrote:

> > > > > sho-lnx-001:~ # rsync -av --progress --stats /mnt/source/*
> > > > > /mnt/destination/
> > > > >
> > > > > -bash: /usr/bin/rsync: Argument list too long
> > > >
> > > > It is just a bash isssue.
> > > 
> > > bash is just passing the error up from the OS
> > 
> > Wrong. Bash's command parameter buffer is too small.
> 
> No, the error is definitely coming from the OS.  I ran the following
> test on my Linux machine:
> 
> strace -f -o echo.strace bash -c '/bin/echo {1..1000000}' >/dev/null
> 
> The output is here:
> 
> http://mattmccutchen.net/private/echo.strace
> 
> Note the execve system call near the end that fails with E2BIG.

20250 write(2, "bash: /bin/echo: Argument list t"..., 40) = 40
20250 exit_group(126)                   = ?


This case is as clear as possible. Just leave the * and bash is out of 
business.


Viele Grüße
Eberhard Mönkeberg (emoenke at gwdg.de, em at kki.org)


More information about the rsync mailing list