Home » Infrastructure » Unix » remove log which are more than 2 months
remove log which are more than 2 months [message #173522] Mon, 22 May 2006 20:31 Go to next message
*Jess*
Messages: 48
Registered: December 2005
Location: Penang, Malaysia
Member

Hi experts,

I would like to create a scheduled script that will automatically remove files that are more than 2 months long.

Appreciate that any1 would give me any guidelines. Thank you.
Re: remove log which are more than 2 months [message #173561 is a reply to message #173522] Tue, 23 May 2006 03:28 Go to previous message
Frank Naude
Messages: 4581
Registered: April 1998
Senior Member
use find with -atime +62 (files not accessed for more than 62 24-hour periods)

$ cd /app/oracle/admin
$ find . -atime +92 -exec rm {} \;


PS: This command is dangerous. Test it on a development environment first!!!
Previous Topic: Opening Port
Next Topic: scripting advise or guidance
Goto Forum:
  


Current Time: Mon Nov 25 17:59:59 CST 2024