Operating System - HP-UX
1753366 Members
6013 Online
108792 Solutions
New Discussion юеВ

TAR: maximum no. of files to be backed-up that can be enumerated

 
SOLVED
Go to solution
Bernard M. dela Vega
Occasional Contributor

TAR: maximum no. of files to be backed-up that can be enumerated

Hello,

I encountered the message, not exact words as this occurred two months ago, which is similar to "argument list too long".

I think this was caused by my last argument in the tar command wherein you list down all the files that you want to back-up.

My question is how many files can I list until I get the above message?

Regards.
6 REPLIES 6
Thierry Poels_1
Honored Contributor
Solution

Re: TAR: maximum no. of files to be backed-up that can be enumerated

Hi,

you probably launched tar with a wildcard. The error you got is caused by a (expanded) command line that is too long! It's more the number of characters (of the filenames) than the number of filenames that is holding you down.

You can for example change "tar cv *" into "tar cv ." (current directory instead of all the files in the current directory, same result) to get a shorter (expanded) command line.

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Steven Sim Kok Leong
Honored Contributor

Re: TAR: maximum no. of files to be backed-up that can be enumerated

Hi,

According to /usr/include/limits.h,

# define _POSIX2_LINE_MAX 2048 /* Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing newline. */

Backup the directory instead so that you will not end up with too long an argument list.

Hope this helps. Regards.

Steven Sim Kok Leong
G. Vrijhoeven
Honored Contributor

Re: TAR: maximum no. of files to be backed-up that can be enumerated

Hi,

it depents on you ux version. the max number of argument you can specify in a command is:
# cat /usr/include/limits.h | grep ARG_MAX
it is in bytes.
20478 in UX10.20 and 2048000 in UX11.

Hope this will help,

Gideon
Steve Steel
Honored Contributor

Re: TAR: maximum no. of files to be backed-up that can be enumerated

Hi

Please read

The kernel tunable parameter "large_ncargs_enabled" is available in 10.X to increase the default size available to pass the environment and argument information to a child process.

With "large_ncargs_enabled" enabled, more buffers are available (2 M vs. 20 K) in the kernel to pass information.

Note: For HP-UX 11.X systems, the limit is set to the larger value by default, so the "large_ncargs_enabled" kernel tunable parameter is not needed.

The PHKL_16750/PHKL_16751 (700)/(800) patch should make the "large_ncargs_enabled" kernel parameter available, so if the appropriate patch (or superceding patch) is not installed, install the latest patch. Note there are a lot of dependencies.



If the "large_ncargs_enabled" kernel parameter is still not available for modification via SAM even after installing the appropriate patch, the following steps may need to be performed to enable the "large_ncargs_enabled" kernel parameter:


1. Define the "large_ncargs_enabled" tunable parameter in the
"/stand/system" system file similar to the following manner:

* Tunable parameters

large_ncargs_enabled 1
maxdsiz 0X04000000
maxfiles 2048
: :

2. Use this modified system file to build a new kernel.

3. Reboot the system.

To return to the default environment size (disable the "large_ncargs_enabled" kernel parameter):

1. Remove the new tunable from the system file,
or set the tunable's value to zero.

2. Use the newly modified system file to rebuild the kernel.

3. Reboot the system.




This is the best solution for a 10 box if this occurs a lot and as shown you are on maximum for 11.


steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Paula J Frazer-Campbell
Honored Contributor

Re: TAR: maximum no. of files to be backed-up that can be enumerated

Hi

Tar info

exit(0)
no error & no warning.

exit(1)
Tar: cannot create temporary file (%s)
Invalid blocksize. (Max %d)
tar: blocksize %d too big, can't get memory
tar:Invalid or non-existent device file %s
Can only create standard output archives
tar: cannot open %s
tar: option not supported for this device %s
tar: cannot write to %s: write protected
tar: usage tar [-]{txruc}[eONvVwAfblhm{op}][0-7[lmh]] ......
Attempt to create archive of no files. Nothing dumped.
tar: cannot preserve extent attributes for %s. aborting...
Tar: cannot create temporary file (%s)
Invalid blocksize. (Max %d)
tar: blocksize %d too big, can't get memory
tar:Invalid or non-existent device file %s
Can only create standard output archives

exit(2)
directory checksum error
tar: %s: HELP - extract write error
tar: Cannot close %s
Tar: tape write error

exit(3)
Tar: tape read error
Tar: tape blocksize error
Tar: blocksize = 0; broken pipe?
Tar: error! blocksize changed

exit(4)
Tar: tape backspace error
Tar: ioctl to write filemarks failed (%d). aborting...
Tar: ioctl to determine device online failed. aborting...

exit(5)
tar: Cannot change directory to '%s'
tar: Path '%s' skipped
tar: cannot open %s
Missing links to %s
tar: %s: cannot access file
tar: Out of memory. Cannot detect symbolic link loops
tar: Loop of symbolic links detected, tar terminated
tar: cannot stat %s. Not dumped.
tar: Size of %s > %s. Not dumped.
tar: %s: directory read error
tar: %s: directory read error
tar: %s: symbolic link too long
tar: can't read symbolic link
tar: %s: cannot open file
tar: %s: link to name too long
Out of memory. Link information lost
%s: file changed size
tar: %s is not a file. Not dumped
tar: %s: symbolic link failed
%s: cannot link
tar: %s couldn't create character device
tar: %s couldn't create block device
tar: %s couldn't create fifo
tar: %s couldn't create directory
tar: %s couldn't create directory
tar: %s - cannot create
tar: chmod failed
tar: chown failed
tar: couldn't get uname for uid %d
tar: couldn't get gname for gid %d
tar: pwd failed
tar: %s: pathname too long
tar: %s: prefix too long
tar: %s: file name too long
%s: file name too long

NOTE: exit code is condsidered as 'NONFATAL_ERRCODE'


Paula
If you can spell SysAdmin then you is one - anon
Sanjay_6
Honored Contributor

Re: TAR: maximum no. of files to be backed-up that can be enumerated

Hi Bernard,

Enable the kernel parameter,

large_ncargs_enabled 1

Rebuild the kernel and reboot and try the command once again.

Hope this helps.

Regds