Re: oldest and newest file/directory within a directory structure
- From: "Taylor, David" <DTaylor@xxxxxxxx>
- Date: Mon, 25 Sep 2006 08:45:44 -0500
Thanks for your input. It has given me an idea for one way to approach
this:
I could create a loop that performs a find on the directory structure
and keep incrementing the mtime value as long as data is being returned.
Hmmm... not pretty but, it would probably provide the functionality that
I am looking for.
Thanks
Davids
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx] On Behalf Of
N. Leenders
Sent: Saturday, September 23, 2006 8:48 PM
To: aix-l@xxxxxxxxxxxxx
Subject: Re: oldest and newest file/directory within a directory
structure
Here is a script (careful, it has wrapped), that gets rid of older files
in /tmp that don't belong to certain users. It makes use of the
opensource find utility. Different versions of "find" may behave a
little
differently. Maybe you can make use of "find" for your purposes too.
#!/usr/bin/ksh
# clean /tmp
/opt/freeware/bin/find /tmp -type f -mtime +32 ! -user 0 ! -user 202 !
-user 222 -exec rm -f {} \; > /dev/null 2>&1
/opt/freeware/bin/find /tmp -type l -mtime +32 ! -user 0 ! -user 202 !
-user 222 -exec rm -f {} \; > /dev/null 2>&1
/opt/freeware/bin/find /tmp -type d -mtime +32 -empty ! -user 0 ! -user
202 ! -user 222 -exec rm -rf {} \; > /dev/null 2>&1
/opt/freeware/bin/find /tmp -type p -mtime +32 ! -user 0 ! -user 202 !
-user 222 -exec rm -f {} \; > /dev/null 2>&1
Nadine Leenders
HPC System Administrator, Research Support
Academic Information and Communication Technologies
University of Alberta
On Fri, 22 Sep 2006, Taylor, David wrote:
Hi *,(size,
Does anyone know of a way to find the oldest and newest file within a
directory structure - to include subdirectories too?
I am writing a script to do some reporting on various directories
# of files, # of directories, etc..) and would also like to be able totoo.
identify the oldest and newest file within each directory structure
TIA
David
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.clearswift.com
**********************************************************************
- Prev by Date: Can't DLPAR more memory to partition
- Next by Date: AIX CDs
- Previous by thread: Re: oldest and newest file/directory within a directory structure
- Next by thread: mksysb and OS CD version
- Index(es):
Relevant Pages
- Re: trouble moving existing site having "self-contained" Pear packages defined within it
... private function __construct ... the site/application class should be
put in on file that is required by ... (which could have a completely different directory structure),
... to do is edit this required script to point the class interfaces to the ...
(alt.php) - Re: trouble moving existing site having "self-contained" Pear packages defined within it
... you should create a site/application class and give it interfaces that point ...
private function __construct ... (which could have a completely different directory
structure), ... to do is edit this required script to point the class interfaces
to the ... (alt.php) - Re: Shell Script Help?
... > Heiner, I decided that as i had a rigid directory structure i could do
... your script on it. ... (comp.unix.shell) - Re: require_once() driving me MAD ! - please HELP
... Each folder contains one or more files. ... echo "In script\n"; ...
"In script Got here Attempting to instantiate db object " ... why I can't seem to use my
directory structure. ... (comp.lang.php) - Re: Problems with require_once() and directory structure
... Each folder contains one or more files. ... echo "In script\n"; ...
"In script Got here Attempting to instantiate db object " ... why I can't seem to use my
directory structure. ... (alt.php)