Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

What limits cp, rsync argument list sizes?

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
jkcunningham
l33t
l33t
Posts: 648
Joined: Mon Apr 28, 2003 4:28 pm
Location: 47.49N 121.79W

What limits cp, rsync argument list sizes?

  • Quote

Post by jkcunningham » Thu Oct 30, 2003 11:21 pm

I was trying to use rsync to update a network drive from a local hard disk on a directory that has about 6500 files in it. It gives me an error message: "Argument list too long". Trying to copy the files with 'cp * <remote drive> does the same thing. If I shorten the list by doing it in pieces it works. So, it appears the error message is correct.

I have no control over the number of files in this case. Is there a way to increase the buffer length used by rsync and cp?

Regards,

-Jeff
Top
meowsqueak
Veteran
Veteran
User avatar
Posts: 1549
Joined: Tue Aug 26, 2003 6:46 am
Location: New Zealand

  • Quote

Post by meowsqueak » Fri Oct 31, 2003 12:38 am

The kernel defines this:

http://www.ussg.iu.edu/hypermail/linux/ ... /0200.html
In include/linux/binfmts.h we can see

/*
* MAX_ARG_PAGES defines the number of pages allocated for arguments
* and envelope for the new program. 32 should suffice, this gives
* a maximum env+arg of 128kB w/4KB pages!
*/
#define MAX_ARG_PAGES 32
Not sure if it's safe to change. You can probably do something equivalent by rearranging your command and/or using find -exec in some way.
Top
jkcunningham
l33t
l33t
Posts: 648
Joined: Mon Apr 28, 2003 4:28 pm
Location: 47.49N 121.79W

  • Quote

Post by jkcunningham » Fri Oct 31, 2003 2:37 am

Yeah, I sort of figured that. There are lots of ways to get around it. But it was a drag having it happen in front of some Windows weenies who, of course, pointed out that they could select that many files in Explorer and move them around without running into any limits. (I retorted that then they would spend the next two hours watching the little piece of paper drift across the frozen progress box - but it wasn't adequate).

Thanks.

Jeff
Top
meowsqueak
Veteran
Veteran
User avatar
Posts: 1549
Joined: Tue Aug 26, 2003 6:46 am
Location: New Zealand

  • Quote

Post by meowsqueak » Fri Oct 31, 2003 2:50 am

You could always go back a directory and cp -R /path/to/dir/ instead. Then you don't have to specify all the files. However it will be recursive.

Or how about something like this (from inside the dir you're copying from):

Code: Select all

$ find . -name \* -exec cp -v \{\} /path/to/dest \;
That's quite an impressive way to copy files around :wink:
Top
jkcunningham
l33t
l33t
Posts: 648
Joined: Mon Apr 28, 2003 4:28 pm
Location: 47.49N 121.79W

  • Quote

Post by jkcunningham » Fri Oct 31, 2003 2:56 am

You're right. Either method would work - and the recursion isn't a problem. But what I really want to do is update, not copy all the files. Only a subset generally need to be copied. The original comand I used which failed was:

> rsync -tuv path/to/directory/* path/to/network/directory

When I tried this, there were really only about a hundred files that needed updating. To do any of the techniques you mentioned and I've thought of would move all the files - which is a horrible waste of bandwidth and time.

-Jeff
Top
Post Reply

5 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic