Thank you. I will try the first sugestion.
However, can you explain me why this command works?
/usr/local/bin/rsync -r --delete --perms --owner --group /mail/spool/imap/user [EMAIL PROTECTED]:/mail/spool/imap
In /mail/spool/imap/user I have a lot of subdirectories with >1000 files.
What I mean is that rsync can make sutch a transfer(no mather the kernel), but for some reason he does not.
Jan-Benedict Glaw wrote:
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
-- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html