-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtsLogrotate
26 lines (24 loc) · 842 Bytes
/
btsLogrotate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# need to cp to logrotate location - enter the command below
# sudo cp ~/bts/btsLogrotate /etc/logrotate.d/btsLogrotate
# sudo logrotate -df /etc/logrotate.d/btsLogrotate
/var/log/bts.log {
weekly
rotate 12
size 20M
compress
delaycompress
missingok
notifempty
create 644 root root
}
# make sure logrotate is executed daily /etc/cron.daily/logrotate
# check status with... cat /var/lib/logrotate/status
# execute logrotate...logrotate -df /etc/logrotate.d/btsLogrotate
# daily - monitor interval of bts.log
# rotate 12 - 12 days of log will be kept
# size 50M - max size, takes precedence over interval
# compress - gzip file
# delaycompress - last file not compressed
# missingok - avoids halting on error and goes to next log file
# notifempty - no log rotation if empty
# create new empty log file with <mode> <owner> <group> spec