Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

max. number of arguments for a "tar" command?????

Evening Guys,

I've run a "find . -type f -mtime +480" command and it gave me more
than a 100,000 files as the result. Now I've gotta pass these files
to a "tar" command and archive 'em all.......but the command

tar cvf abc.tar `find . -type f -mtime +480` says

/usr/bin/tar: argument list too long

and quits to the command prompt again. Any way out of this trouble???

Any ways to archive all the 100,000+ files at once WITHOUT writing a
dumb "for" loop in a shell script????????? PLEASE I NEED THIS INFORMATION FAST.............

Cheers.

Comments

  • Jeff P.Jeff P. Member Posts: 196
    : Evening Guys,
    :
    : I've run a "find . -type f -mtime +480" command and it gave me more
    : than a 100,000 files as the result. Now I've gotta pass these files
    : to a "tar" command and archive 'em all.......but the command
    :
    : tar cvf abc.tar `find . -type f -mtime +480` says
    :
    : /usr/bin/tar: argument list too long
    :
    : and quits to the command prompt again. Any way out of this trouble???
    :
    : Any ways to archive all the 100,000+ files at once WITHOUT writing a
    : dumb "for" loop in a shell script?????????

    : PLEASE I NEED THIS INFORMATION FAST.............

    FAST? You mean like two months later? ;-)
    [code]
    find . -type f -mtime +480 > mytar.list
    tar --create --verbose --files-from=mytar.list --file=abc.tar
    [/code]
  • Justin BibJustin Bib USAMember Posts: 0

    _______ || http://forcoder.org || free video tutorials and ebooks about \ Python, JavaScript, C++, Java, C#, Visual Basic .NET, Scratch, Delphi, PHP, Perl, PL/SQL, Objective-C, MATLAB, C, R, Visual Basic, Assembly, Swift, Go, Ruby Julia, SAS, VBScript, Awk, Transact-SQL, Scala, LabVIEW, Hack, Erlang, Fortran, Alice, D, ABAP, Ada, Lua, Crystal, Dart, Rust, F#, Bash, Apex, Kotlin, Clojure, Logo, Scheme, Lisp, Prolog, FoxPro, ML, COBOL \ ___________

Sign In or Register to comment.