Re: log storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 -----
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

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux