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
LVL 8
LindaCAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.