log storage

sysadmin sysadmin at fleetone.com
Wed Jan 21 17:35:01 UTC 2004


Here is how you can find files longer then 30 days and remove them:

find /file location/* -mtime +30 -exec ls {} \;
find /file location/* -mtime +30 -exec rm {} \;

The first find will just list the files over 30 days, the second command actually removes the files that are over 30 days old.

I would think for the file size, you can use the -printf format command instead of the mtime command, but not sure.  If you run a man find on your fedora box, it should give you the right commands.

Rob



  ----- Original Message ----- 
  From: Genti A. Hila 
  To: fedora-list at redhat.com 
  Sent: Wednesday, January 21, 2004 11:24 AM
  Subject: log storage


  Hi list,

  I want to use a Fedora box as storage server for PIX logging, because I want to keep track of them and analyze.
  Now I want to keep the logs for one month. And once each directory or file is older than 30 days, I want it to be deleted. So each day, some files are deleted.
  At the same time. because this logs are huge, it might happen that HDD fills up. In order to prevent this from happening, I would like to set a certain size for the logs. If this fills up, than the older logs are automatically deleted even though they are not yet 30 days old.

  Does any body, has a suggestion how to do this ? What tool to use, or maybe some link that has more information on that.
  I do not mind reading but I just do not know where to start.

  Thank you.
  You're wonderful list.

  Genti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040121/94a82e82/attachment-0001.htm>


More information about the fedora-list mailing list