Tuesday, December 20, 2011

Logrotate

Steps to set logrotation :
1.  Login as root in shell.
2.  cd /etc/logrotate.d
3.  create file rotate_abc

Example:
/xyz/pqr/abc {
        weekly
        rotate 4
        compress
}

Syntax:
path_of_file {
daily/weekly
rotate 1/2/3/4
compress
}

4.Done.

To check logrotation history :
cat /var/lib/logrotate.status

A good url to learn logrotation :
http://linuxers.org/howto/howto-use-logrotate-manage-log-files

No comments:

Post a Comment