Tar: Parameter list is too long

Hi all,

I have a lot of files in my audit log directory which i am trying to tar. However, i hit the below error:
ksh: /usr/bin/tar: 0403-027 The parameter list is too long.

Is there any work around to resolve this problem? I need to tar all the files up.

Thanks.

try reading this

or could you create the tar of fewer files, and then add the remaining files to it?

$ find . -name '<whatever wildcard>' -print | xargs tar -rf audit.tar
OR
$ find . -name '<whatever wildcard>' -exec tar -rf audit.tar {} \;

If your tar doesn't support starting a new archive when -r is used, create it first using an empty file.

Hi pludi,

I tried the suggestion of using 'find . -name '<whatever wildcard>' -exec tar -rf audit.tar {} \;' but hit error.

That leads to another question? How do I create an empty tar file in AIX 5.3?

Thanks.

Why not try moving all audit log files to another dir, and then tar up that dir?

just create an empty tar file using toch

touch audit.tar
find . -name "*.log" -print | xargs tar -uvf audit.tar 

from the current directory..

cheers,
Devaraj Takhellambam