Large FULL Log Files

Hello… found some large OLD files … is it safe to delete them :

-rw-rw-r-- 1 asterisk asterisk 3.8G Aug 2 2021 ./full.77
-rw-rw-r-- 1 asterisk asterisk 4.4G Aug 6 2021 ./full.75
-rw-rw-r-- 1 asterisk asterisk 4.5G Sep 1 2021 ./full.68

rotate option set to 3

/var/log/asterisk/full {
missingok
rotate 3
daily
create 0640 asterisk asterisk
postrotate
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

HI,
Consider the following:

/var/log/asterisk/full {
daily
missingok
compress
rotate 7
notifempty
sharedscripts
create 0640 asterisk asterisk
su asterisk asterisk
postrotate
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

I only keep 7 logs in .gz format. There is one caveat, when your version of asterisk changes due to upgrade, it will mv /etc/logrotate.d/asterisk to /etc/logrotate.d/asterisk-rpmsave. You will then have to rm -f asterisk and mv asterisk-rpmsave asterisk in /etc/logrotate.d

Hope that helps.

thanks …I have not tried compressed options… before … I will do a test… The rotate option, seems to be working now, but still have a list of FULL.xx files… which would like to remove …

Hi,
You can try to delete the files you don’t want:

For example:

cd /var/log/asterisk

rm -f freepbx.log-20220720

Might find there are a bunch of files with the -log-some-date’ like
queue_log-20220820
rm -f queue_log-*
that is just an example.

If you cleaned out the extraneous log and you have the compressed option enabled in /etc/logrotate.d/asterisk as shown above, you should start seeing files with the .gz suffix.
Cheers

i guess that’s the option i was looking for… thanks … will check these options … really appreciate your time and Help @Hawkeye

You might also look at the logs if they are much larger than you expect. Possible situations include pjsip logger or sip debug inadvertently left on, attackers hammering on your system, devices repeatedly becoming unreachable and reachable, etc.

yes, thanks for that information… i have been checking those large Logs… but most of them are 1 year old…

now I can see the logs rotation and compressed
-rw-r----- 1 asterisk 76303464 Sep 7 04:02 full-20220907
-rw-r----- 1 asterisk 72773116 Sep 8 04:02 full-20220908
-rw-r----- 1 asterisk 77663747 Sep 9 04:02 full-20220909
-rw-r----- 1 asterisk 7164378 Sep 10 04:02 full-20220910.gz

thanks a lot for your directions… TEAM!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.