daily cron

Status
Not open for further replies.

falk

Member
Feb 2, 2019
76
5
8
53
Hi
in 4.5.22
i notice change in log file :
it Wes: freeswitch.log.1 and now: freeswitch.log



is that the correct line to put in cron daily?:

find /var/log/freeswitch/freeswitch.log.* -mtime +7 -exec rm {} \;

thanks
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,417
376
83
If you are using the packaged install of FreeSWITCH (most do), then yes that is correct.
Otherwise use find /usr/local/freeswitch/log/freeswitch.log.* -mtime +7 -exec rm {} \;
 

falk

Member
Feb 2, 2019
76
5
8
53
If you are using the packaged install of FreeSWITCH (most do), then yes that is correct.
Otherwise use find /usr/local/freeswitch/log/freeswitch.log.* -mtime +7 -exec rm {} \;
Hi Adrian
Thanks for your replay

i was using this
but i notice that after upgrade I make to 4.5.22 the log file start to grow
and the crone doesn’t do the work –
i check the log file path and the name of the file change to : freeswitch.log it was freeswitch.log.* (1.2.3,4)

I update the line to : find /var/log/freeswitch/freeswitch.log -mtime +7 -exec rm {} \;

When I run the cron manual ./ still didn’t delete the file
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,417
376
83
Your original find command was correct you SHOULD NOT be removing freeswitch.log

freeswitch.log is the current log file that FreeSWITCH is writing to. files that end in 1, 2, 3 etc are the rotated logs that the find using freeswitch.log.* deletes.

If you do not see any files called freeswitch.log.1 freeswithc.log.2 (3, 4, 5) etc. then your log has not rotated since the last time files were deleted. There could be many reasons for this but it could be that your log file has not yet grown large enough. The default install sets the log rotate size to 10485760. Check the current size of your log and then see what is specified in /etc/freeswitch/autoload_configs/logfile.conf.xml
 

falk

Member
Feb 2, 2019
76
5
8
53
Ok thanks for the explanation
I didn’t now that
The size is 8000456 so I will follow this
 

falk

Member
Feb 2, 2019
76
5
8
53
Hi Adrian
its working thanks for your help
i restart the switch and than the rotated logs start to work
so i fix the line in the cron and solved
thanks
 
Status
Not open for further replies.