RE: Deleting files from O/S older than 6 hours

  • From: "Ken Naim" <kennaim@xxxxxxxxx>
  • To: <ajayoraclel@xxxxxxxxx>, "'Remigiusz Sokolowski'" <rems@xxxxxxxx>
  • Date: Wed, 28 Nov 2007 18:48:49 -0500

Since these files are not that important since they can be deleted after 6
hours? can you just create subdirectory and move all the files to the
subdirectory and then every 6 hours remove the files in the subdirectory and
then move the files from the parent directory?

 

rm /.../parent/subdir/*

mv /.../parent/*.ext /.../parent/subdir/

 

Ken

 

  _____  

From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Ajay Thotangare
Sent: Wednesday, November 28, 2007 1:53 PM
To: Remigiusz Sokolowski
Cc: oracle-l@xxxxxxxxxxxxx
Subject: Re: Deleting files from O/S older than 6 hours

 

Yes, I am using this option now. 

Another problem is get the date/time for creating file 6hours before time.

Currently I managed to do this by doing to_char(sysdate-6/24,'mmddhh24mi')
in sqlplus and getting value in unix shell variable. Is there any way I can
minus 6 hours from current date/time in unix and get in format mmddhh24mi ?

Thanks for your help


Remigiusz Sokolowski <rems@xxxxxxxx> wrote:

Ajay Thotangare wrote:
> Hi,
> 
> I am using following command to delete files from o/s older than 24 hours.
> /usr/bin/find /u01/log/*.log -mtime +0 -exec ls -l {} \;
> 
> Is there any way I can delete files older than 6 hours. I am using 
> HP-UNIX. I tried using
> /usr/bin/find /u01/log/*.log -mtime +0.4 -exec ls -l {} \;
> Above command does not work.
> 
may be there is option -newer on HP-UX (I don't have any such box here) 
- if so, one can touch fake file with proper time
Then find will operate on files newer than fake file

-- 

------------------------------------------------------------------------
Remigiusz Sokolowski 
WP/PTI/DIP/ZAB (+04858) 52 15 770
MySQL v04.x,05.x; Oracle v10.x

Zastrzezenia:
1. Wylaczenie danej funkcjonalnosci oznacza, ze niezwlocznie przystapimy
lub juz pracujemy nad jej uruchomieniem
2. Niniejsza wiadomosc stanowi jedynie wyraz prywatnych pogladow autora 
i nie jest w zadnym wypadku zwiazana ze stanowiskiem przedsiebiorstwa 
Wirtualna Polska S.A.
------------------------------------------------------------------------



WIRTUALNA POLSKA SA, ul. Traugutta 115c, 80-226 Gdansk; NIP: 957-07-51-216; 
Sad Rejonowy Gdansk-Polnoc KRS 0000068548, kapital zakladowy 62.880.024
zlotych (w calosci wplacony)

 

  

  _____  

Get easy, one-click access to your favorites. Make Yahoo!
<http://us.rd.yahoo.com/evt=51443/*http:/www.yahoo.com/r/hs>  your homepage.


Other related posts: