cd /ud/TEST/_PH_
find . -mtime +90 -exec rm {} \;
With find you're working with one file at a time so you should never
hit
the limit.
Another point to remember is using xargs you can control the number of files
in each rm.
For example
find . -mtime +90 | xargs -l20 rm (deletes 20
Bounce notice: If you read this list through Indexfocus, Nabble, or any other
replicator - and you would like to be able to participate - sign up
directly with us. Here's all you need to know: To subscribe or
resubscribe please visit http://listserver.u2ug.org/.
REPOSTED FOR NON-MEMBER ADDRESS:
NCARGS value configuration (5.1.0)
In AIX 5L Version 5.1, the option has been added to allow the super user or
any user belonging to the system group to dynamically change the value of
the NCARGS parameters. In previous releases of AIX, these values were
permanently defined as 24576, which
Use the find statement to select the files you want to process (man find
will explain) an then let find execute the mv or rm whatever you need.
Example:
Find . -name *tobedeleted* -exec rm {} \; -print
The -exec will execute something, substituting the {} with the current file
name, the\; ends
Does anyone know:
1. what I'm talking about and what causes it?
Commands like rm have what appears to be (not a scientific analysis, and if
memory serves) an 8K name space limit, including delimiters...
2. how to solve this through some tunable parameter, preferrably not
requiring a kernel
There is a parameter somewhere that lets you control the maximum size of an
AIX input statement, but not only do I not know where this is, if there's a
max you're inevitably going to run into it periodically no matter how big it
is. So rather than using AIX's poor excuse for globbing, I've been
Karl:
In backup scripts I do the following:
# remove any local archives over 10 days old
echo Removing 10 days old local archive file(s)...
find $LOCAL_ARCHIVE -name '*.tgz' -mtime +10 -exec rm {} \;
find $LOCAL_ARCHIVE -name '*.bkf' -mtime +10 -exec rm {} \;
find $LOCAL_ARCHIVE -name '*.rar'
I usually us the 'find' command with the '-mtime' to pare down the list of
files in the directory that I am dealing with. For Instance, if I wanted to
look at all files over 30 days, I would:
(I am assuming that I have do a 'cd' to the directory. Otherwise the '.' in the
command needs to be a
If you are using the ls command to list the files in the directory, try
using the find command instead. The ls command is faster, but it has
issues with really large numbers of files.
--
Charlie Rubeor
Senior Database Administrator
Hi Karl,
We ran into this too, and the Unix xargs command took care of it
nicely.
Example:
The following purge will delete the files for a single month (assuming
you don't keep more than a year's worth, in which case you'll need to
check the year, too).
This string will prompt before purging
This is a common problem, where the shell expands the argument list until it
blows up. The most common way around this is to use xargs:
http://www.unixreview.com/documents/s=8274/sam0306g/
/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006
On 8/21/07, [EMAIL PROTECTED] [EMAIL
On 8/21/07, Kevin King [EMAIL PROTECTED] wrote:
[snip]
cd /ud/TEST/_PH_
find . -mtime +90 -exec rm {} \;
With find you're working with one file at a time so you should never hit
the limit.
Yes, however using find + xargs is more efficient than executing rm on each
individual instance of
files.
From: Jeff Schasny [EMAIL PROTECTED]
Reply-To: u2-users@listserver.u2ug.org
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] AIX Argument list too long
Date: Tue, 21 Aug 2007 08:51:30 -0600
NCARGS value configuration (5.1.0)
In AIX 5L Version 5.1, the option has been added to allow
13 matches
Mail list logo