Logrotate sample script to moving old archieve log to directory in different disk
Log rotate sample script
/var/log/SoaPlan.err {
daily
rotate 28
missingok
notifempty
# olddir /var/log/PaymentRobot
# compress
dateext
compress
# compresscmd /bin/bzip2
compresscmd /usr/bin/bzip2
compressext .bz2
copytruncate
sharedscripts
# postrotate
lastaction
day=$(date +%Y%m%d)
daytime=$(date +%Y%m%d-%H:%M:%S)
mv SoaPlan.err-$day.bz2 /var/log/soaplan/SoaPlan.err-$daytime.bz2
endscript
}
Command to compress file using bzip2
Tidak ada komentar :
Posting Komentar