• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1975
  • Last Modified:

If ncargs 128 ARG/ENV list size in 4K byte blocks True - then if files eq in size what is the limit of the list?

If ncargs 128 ARG/ENV list size in 4K byte blocks True - then - if the files are equal in size, what is the maximum amount of the list permitted to avoid this message in a rm script?

The parameter list is too long
0
LindaC
Asked:
LindaC
  • 10
  • 7
1 Solution
 
woolmilkporcCommented:
Hi again,
check the size limit of the argument list which is actually in effect (depending on ncargs) with
getconf ARG_MAX
No need to calculate it by yourself. In your case (ncargs=128) the limit should be 524288 (128*4096).
The filesize doesn't matter here, it's the length of the filename (including the path) that counts.
The maximum length of a path is almost always 1024, with 256 being the POSIX minimum.
Check with getconf PATH_MAX pathname
So you can't say how long your argument list is allowed to be. It depends on the path length.
Btw. the maximum value for ncargs is 1024 (4K byte blocks)
wmp
0
 
LindaCAuthor Commented:
Thank you.  I just want the maximum amount of files based on the ncargs that I supplied.
Can you provide a numer?  That's it, just a number.
0
 
woolmilkporcCommented:
42.

No, joke aside, I can't give you a number, because I don't know the length of the affected filenames, including the path component. If this length were known you could simpy divide 524288 by it to get your number.

Can't you use rm in combination with find/xargs? xargs will split the parameter list into suitable chunks.

wmp
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
LindaCAuthor Commented:
rp
0
 
LindaCAuthor Commented:
This is the rm script:

tbsprod-oracle:/home/oracle/dba/scripts> more rmtrace.sh
find /tbsprod/ora1/TBSPROD/admin/udump/*.trc -type f ! -mtime -7 -exec rm {} \;
find /tbsprod/ora1/TBSPROD/admin/bdump/*.trc -type f ! -mtime -5 -exec rm {} \;
find /tbsprod/ora1/TBSPROD/admin/adump/* -type f ! -mtime -5 -exec rm {} \;
find /home/app/oracle/product/9.2.0/rdbms/audit/* -type f ! -mtime -5 -exec rm {} \;
find /home/oracle/dba/logs/* -type f ! -mtime -7 -exec rm {} \;

Then how is the find with the Xargs ?
0
 
LindaCAuthor Commented:
This are some of the file_names in the /tbsprod/ora1/TBSPROD/admin/udump/  path.

tbsprod_ora_749808.trc
tbsprod_ora_1982516.trc

tbsprod_ora_925792.trc
tbsprod_ora_1323086.tr

tbsprod_ora_2048050.trc

tbsprod_ora_979158.trc
tbsprod_ora_2060494.trc

tbsprod_ora_2064418.trc

tbsprod_ora_1785994.trc
0
 
woolmilkporcCommented:
~ 65000

find /tbsprod/ora1/TBSPROD/admin/udump -type f -name "tbsprod*.trc" | xargs rm

Matching files in subdirectories will be processed also.

wmp
0
 
woolmilkporcCommented:
Of course you must add your "-mtime" options!
0
 
LindaCAuthor Commented:
Checking
0
 
LindaCAuthor Commented:
It is not removing, see April 12 trace files there::

find /tbsprod/ora1/TBSPROD/admin/udump -type f -mtime -2 -name "tbsprod*.trc" | xargs rm

tbsprod-oracle:/tbsprod/ora1/TBSPROD/admin/udump> ls -ltr
total 3800
-rw-r-----    1 oracle   dba            7894 Mar 20 11:00 control.sql
-rw-r-----    1 oracle   dba            7806 Apr 12 15:52 tbsprod_ora_749808.trc
-rw-r-----    1 oracle   dba            7809 Apr 12 15:56 tbsprod_ora_1982516.tr
c
-rw-r-----    1 oracle   dba            7807 Apr 12 16:00 tbsprod_ora_925792.trc
-rw-r-----    1 oracle   dba            7808 Apr 12 16:03 tbsprod_ora_1323086.tr
c
-rw-r-----    1 oracle   dba            7809 Apr 12 16:40 tbsprod_ora_2048050.tr
c
-rw-r-----    1 oracle   dba          947951 Apr 14 08:09 tbsprod_ora_979158.trc
-rw-r-----    1 oracle   dba          942296 Apr 14 08:09 tbsprod_ora_2060494.tr
c
0
 
LindaCAuthor Commented:
Ok, it worked like this: (I missed the exclamation)
find /tbsprod/ora1/TBSPROD/admin/udump -type f ! -mtime -2 -name "tbsprod*.trc" | xargs rm
0
 
LindaCAuthor Commented:
Is this problem in Aix only, or it is also on solaris?
0
 
LindaCAuthor Commented:
Thank you.
0
 
woolmilkporcCommented:
Argument lists are of limited size in any Unix. Solaris has 1M for 32bit and 2M for 64bit systems.

The nice thing with AIX is that you can increase it on the fly. Don't know whether this can be done with Solaris.

wmp
0
 
woolmilkporcCommented:
Btw. LindaC, what is "rp" ?
0
 
LindaCAuthor Commented:
Raising points.
0
 
woolmilkporcCommented:
Oh yeah,

thx for the info, for rp and for awarding those rp.

wmp


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 10
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now