On Tue, 2004-08-10 14:41:54 +0300, victor <[EMAIL PROTECTED]>
wrote in message <[EMAIL PROTECTED]>:
> I get this error when I try to copy a directory with a lot of files: 
> "bash: /usr/local/bin/rsync: Argument list too long"
> 
> The exact command is: "/usr/local/bin/rsync -rsh=/usr/bin/rsh -r 
> --delete --perms --owner --group /mail/spool/imap/user/wex/* 
> [EMAIL PROTECTED]:/mail/spool/imap/user/wex".

The "*" you supply is expanded by the shell to a lot of filenames. Your
shell uses some internal buffer (which may grow to several megabytes),
but upon exec*(), the kernel cannot copy all the list to the (child's)
argv[] buffer, thus rejecting to exec() at all.

So this isn't actually a limitation of your shell, but of your operating
system. IIRC Linux will grant you some 128 KB on systems using 4KB pages
(that is, the famous PeeCee).

You've got several ways to work around that:

        - Try to split your single rsync call into severals:

                rsync a*
                rsync b*
                rsync c*
                ...

        - Hack your operating system's kernel to allow a larger buffer
          for argv[]. (For Linux, you'll need to edit
          ./include/linux/binfmts.h; change MAX_ARG_PAGES to whatever
          you like better)

        - Try to use xargs, but that may be tricky...

MfG, JBG

-- 
Jan-Benedict Glaw       [EMAIL PROTECTED]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Attachment: signature.asc
Description: Digital signature

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to