Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

tar Argument list too long

  • 28-01-2002 11:11am
    #1
    Closed Accounts Posts: 1,651 ✭✭✭


    Too many files I guess, so I try to use:
    ls | xargs tar zcf myArchive.tar.gz
    which doesn't work at all.
    Anyone know how to tar an arhive with too many files for the arg list?


Comments

  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    Hmm got it.
    tar zcf myArchive.tar.gz .

    Just used a normal tar with a dot instead of star...
    weird.


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    or
    tar cvf somearchive.tar somedir/*.*
    ?


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    No, that way it takes the list of files in the directory as it's arguement list, when you just use dot, or give the dirname it's just taking the dirname as the arg list.


  • Closed Accounts Posts: 296 ✭✭moist


    Not that it matters now as you found a way around it, but you could use...

    ls | xargs tar -r -f blah.tar
    gzip -9 blah.tar

    You have to gzip seperately as tar (apparently) can't update or verify compressed archives.


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    opps i didn't really read what you posted

    this would probably work too
    tar cvf foo.tar someargumentlist > out.txt
    more out.txt
    ?


  • Advertisement
  • Closed Accounts Posts: 296 ✭✭moist


    Originally posted by Typedef
    opps i didn't really read what you posted

    this would probably work too
    tar cvf foo.tar someargumentlist > out.txt
    more out.txt
    ?

    No, your still reading it wrong, (s)he was trying
    to tar up everyting in
    the directory using 'tar -zcvf blah.tgz *'
    However the number and name lenght of files in the directory were too long for
    tars' ARGV buffer.

    From errno(2):

    7 E2BIG Arg list too long. The number of bytes used for the argument and
    environment list of the new process exceeded the current limit of
    65536 bytes (NCARGS in <sys/param.h>).


Advertisement