Operating System - HP-UX
1752815 Members
6138 Online
108789 Solutions
New Discussion юеВ

Re: Files 15 mins older than sysdate

 
SOLVED
Go to solution
Ganesan R
Honored Contributor

Re: Files 15 mins older than sysdate

Hi,

Restart the swagentd daemon.

#/usr/sbin/swagentd -r
Best wishes,

Ganesh.
Yvonne Butler
Regular Advisor

Re: Files 15 mins older than sysdate

Hmm, that perl command doesn't seem to return the 15+ minutes older than sysdate count of files in the directory:

root: /oraother/dst/comms/outtray # ll
total 9616
-rw------- 1 dstdba dba 2417496 Feb 6 2008 core.0468
-rw------- 1 dstdba dba 2483032 Jan 31 2008 core.9416
-rw-r--r-- 1 dstdba dba 786 Feb 6 2008 sqlnet.log.0452
-rw-r--r-- 1 dstdba dba 832 Feb 6 2008 sqlnet.log.0456
-rw-r--r-- 1 dstdba dba 786 Feb 6 2008 sqlnet.log.0469
-rw-r--r-- 1 dstdba dba 786 Feb 6 2008 sqlnet.log.0471
-rw-r--r-- 1 dstdba dba 832 Feb 15 2008 sqlnet.log.2185
-rw-r--r-- 1 dstdba dba 786 Feb 15 2008 sqlnet.log.2187
-rw-r--r-- 1 dstdba dba 786 Jan 31 2008 sqlnet.log.9393
-rw-r--r-- 1 dstdba dba 786 Jan 31 2008 sqlnet.log.9412
-rw-r--r-- 1 dstdba dba 786 Jan 31 2008 sqlnet.log.9416
-rw-r--r-- 1 dstdba dba 832 Feb 5 2008 sqlnet.log.9805

root: /oraother/dst/comms/outtray # perl -MFile::Find -le '$path=shift||qq(.);find(sub{print $File::Find::name if -f $_&&-M_ >=(15/(60*24))},$path)' /oraother/dst/comms/outtray | wc -l
0

Any ideas?
James R. Ferguson
Acclaimed Contributor
Solution

Re: Files 15 mins older than sysdate

Hi Yvonne:

There are two problems here -- both mine!

First, it looks like in the second post I made I lost some whitespace. There is actually a warning that we could see:

# perl -MFile::Find -wle '$path=shift||qq(.);find(sub{print $File::Find::name if -f $_&&-M_ >=(15/(60*24))},$path)'

Next, my original, math was horrible! FOr files older than 15-minutes we need:

# perl -MFile::Find -le '$path=shift||qq(.);find(sub{print $File::Find::name if -f $_ && -M _ >= ((15*60)/(60*60*24))},$path)'

You will see that I haven't tried to factor in my head :-)

The '-M' tests the modification age of a file in the number of DAYS, so the expression represents that fraction of a DAY that is 15-minutes.

My apologies again, but at least your Perl is reasonably up-to-date now!

Regards!

...JRF...
Yvonne Butler
Regular Advisor

Re: Files 15 mins older than sysdate

Thanks very much James, that revised Perl command does exactly what I need (with a "| wc -l" at the end).