2

Possible Duplicate:
Script to delete files older than 30days

My hard disk suddenly became full and I searched around until I finally discovered that a "console.log.9" file buried in Library/Logs/Console/myname/ was 112 Gigs !

I couldn't able to open and check it properly.

I did some research and figured out the way for finding and deleting the log files older than 30 days from a specific path, using find and exec commands.

find /export/home/ftp ( -name console.log -or -name server.log ) -mtime +30 -exec rm -f {} +

But i want to rotate console.log in daily wise and Is any shell script to rotate the console.log daily.

Please help me out in this issue.

Jayakrishnan T
  • 298
  • 2
  • 8
  • 22
  • Duplicate post: http://serverfault.com/questions/212751/script-to-delete-files-older-than-30days – sinping Dec 15 '10 at 15:06

1 Answers1

8

Add a file to /etc/logrotate.d, containing something like

/export/home/ftp/console.log {
  rotate 7
  daily
  compress
  missingok
  notifempty
}
Joril
  • 1,610
  • 1
  • 21
  • 28