·Î±× ·ÎÅ×ÀÌÆ®°¡ Á¦´ë·Î ÀÛµ¿¾ÈµÇ°í ÀÖÀ½
# ls -l syslog*
-rw-r----- 1 syslog adm 521289745 Feb 13 11:51 syslog
-rw-r----- 1 syslog adm 139767272 Jan 22 11:50 syslog.1
-rw-r----- 1 syslog adm 3844697362 Jan 16 09:21 syslog.2.gz
-rw-r----- 1 syslog adm 79583687 Dec 5 06:25 syslog.3.gz
-rw-r----- 1 syslog adm 77608752 Dec 4 06:25 syslog.4.gz
-rw-r----- 1 syslog adm 74058606 Dec 3 06:25 syslog.5.gz
-rw-r----- 1 syslog adm 71636883 Dec 2 06:25 syslog.6.gz
-rw-r----- 1 syslog adm 72745054 Dec 1 06:25 syslog.7.gz
-d, --debug Don't do anything, just test (implies -v)
-f, --force Force file rotation
# logrotate -d -f /etc/logrotate.d/rsyslog
...................................
rotating pattern: /var/log/syslog
forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/syslog
error: skipping "/var/log/syslog" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
...................................
:: À¯Àú±ÇÇÑ ºÎ¿©
# vim /etc/logrotate.d/rsyslog
/var/log/syslog
{
rotate 6
daily
missingok
notifempty
delaycompress
compress
su root root ### Ãß°¡
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
# logrotate -f /etc/logrotate.d/rsyslog
-rw-r----- 1 syslog adm 574 Feb 13 11:53 syslog
-rw-r----- 1 syslog adm 521326375 Feb 13 11:53 syslog.1
-rw-r----- 1 syslog adm 23230928 Jan 22 11:50 syslog.2.gz
-rw-r----- 1 syslog adm 3844697362 Jan 16 09:21 syslog.3.gz
-rw-r----- 1 syslog adm 79583687 Dec 5 06:25 syslog.4.gz
-rw-r----- 1 syslog adm 77608752 Dec 4 06:25 syslog.5.gz
-rw-r----- 1 syslog adm 74058606 Dec 3 06:25 syslog.6.gz
-rw-r----- 1 syslog adm 71636883 Dec 2 06:25 syslog.7.gz