/usr/sbin/logrotate is used to log rotate syslog-NG logging, as shown below:
[root@machine1 output]# crontab -l
# 00 23 * * * /TSM/bkup 1>/dev/null 2>&1
1 * * * * /usr/sbin/logrotate /app/syslog-ng/custom/conf/syslog-ng-rotate.conf
[root@machine1 output]#
[root@machine1 output]# pwd
/app/syslog-ng/custom/output
[root@machine1 output]# ls -l
total 4
-rw------- 1 root root 142 Oct 3 16:08 all_devices.log
[root@machine1 output]#
[root@machine1 output]#
[root@machine1 output]# date
Wed Oct 10 11:26:54 EDT 2018
[root@machine1 output]#
[root@machine1 output]#
[root@machine1 output]# cat /app/syslog-ng/custom/conf/syslog-ng-rotate.conf
/app/syslog-ng/custom/output/all_devices.log {
copytruncate
dateext
rotate 365
daily
sharedscripts
compress
postrotate
/app/syslog-ng/sbin/syslog-ng-ctl reload
endscript
}
[root@machine1 output]#
[root@machine1 output]#
[root@machine1 output]# date
Wed Oct 10 11:29:51 EDT 2018
[root@machine1 output]#
[root@machine1 output]#
[root@machine1 output]# ls -l
total 4
-rw------- 1 root root 142 Oct 3 16:08 all_devices.log
[root@machine1 output]# /usr/sbin/logrotate /app/syslog-ng/custom/conf/syslog-ng-rotate.conf
[root@machine1 output]# ls -l
total 4
-rw------- 1 root root 142 Oct 3 16:08 all_devices.log
[root@machine1 output]#
But, I do not see compressed file getting generated in ../output folder, every minute(crontab).
why logrotate does not generate compressed file??