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

  • From: Ajay Thotangare <ajayoraclel@xxxxxxxxx>
  • To: Remigiusz Sokolowski <rems@xxxxxxxx>
  • Date: Wed, 28 Nov 2007 10:53:01 -0800 (PST)

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! your homepage.

Other related posts: