Avaya IP Office Server Edition Remove Log Files to Free Up Space

Avaya IP Office Server Edition Remove Log Files to Free Up Space

CommsPlus DistributionA picture containing text, clipartDescription automatically generated


Avaya IP Office Server Edition Remove Log Files to Free Up Space



Over time, log files on the IPOSE will be created, these can cause the primary hard drive to reach capacity and affect the IPOSE performance.

Browse to Platform View (example: https://192.168.42.1:7071and check the Disk Usage.

In the below example we can see the disk usage is at 92%.

Access the IPOSE via SSH

Browse to the below folder locations and check the files


/opt/Avaya/apache-tomcat/logs

/opt/Avaya/oneXportal/11.1.2300_6/apache-tomcat/logs

/var/log/audit


(Note the version 11.1.2300_6 in thexample above might be different on your system, you will need to use commands below to navigate to the parent directory and list the folders to confirm the correct name)


cd /opt/Avaya/oneXportal    - command navigates to the directory.


ls                - command lists all files & folders in the directory.



Commands to delete files in directory /opt/Avaya/apache-tomcat/logs

cd /opt/Avaya/apache-tomcat/logs    - command navigates to the directory.

ls                    - command lists all files & folders in the directory.

“rm” *                    - command deletes all files in directory.


Commands to delete files in directory /opt/Avaya/oneXportal/11.1.2300_6/apache-tomcat/logs

cd /opt/Avaya/apache-tomcat/logs    - command navigates to the directory.

ls                    - command lists all files & folders in the directory.

“rm” *                    - command deletes all files in directory.



Commands to delete files in directory /var/log/audit

cd /var/log/audit            - command navigates to the directory.

ls                    - command lists all files & folders in the directory.

“rm” *                    - command deletes all files in directory.


Once files have been deleted

Browse to Platform View (example: https://192.168.42.1:7071) and check the Disk Usage.

In the below example we can see the disk usage is now at 24%.



Creating a Job in Linux to Automatically Delete Audit Log Files


Note the below commands will work for 11.1 and below IPOSE
12.0 and above IPOSE will need to follow the Avaya Solution found on the URL https://support.avaya.com/ext/index?page=content&id=SOLN378353&viewlocale=en_US


Access the IPOSE via SSH (example putty)

Browse to the folder with the command.

cd /var/log/audit


list the files in the folder currently with the command. (if you have just run the script manually then you should see the file list is now less than when first checked)

ls


Create a folder with the command.

mkdir deleteoldlog


Browse to the new folder with the command.

cd /var/log/audit/deleteoldlog


Create Script file with the command.

nano delete-old-log-script.sh



Enter the below in Script (to delete files older than 7 days)

find /var/log/audit/*.* -mtime +7 -type f -delete

A computer screen with white textDescription automatically generated


Select

Ctrl+X (save)

Y (to confirm the changes)

Enter (to save and exit)


Update the permission of the script file with the command.

chmod +x delete-old-log-script.sh


At this stage you can manually run the script to confirm working with the command.

./delete-old-log-script.sh


Browse to the folder with the command.

cd /var/log/audit


list the files in the folder currently with the command. (if you have just run the script manually then you should see the file list is now less than when first checked)

ls


To set the script to run automatically, open the crontab with the command.

crontab -e


Scroll to the bottom (end) of the current configuration and 

press i (to insert)

Select Enter to start a new line.


Add a new line as per the below (in the below this will run the script weekly on Monday at 3am, you can use the website https://crontab.guru/ to work out the configuration to use, if you want to run the script at a different time


00 3 * * 1 /var/log/audit/deleteoldlog/delete-old-log-script.sh

A screen shot of a computer programDescription automatically generated


press esc (to stop inserting)


To exit, enter the below command (then press Enter):

:wq


The script will close and the crontab will update.


To confirm the changes in the crontab, use the command to open and confirm your new schedule is displayed.

crontab -e

use the command :wq and Enter to close

A screen shot of a computer programDescription automatically generated


The script is now scheduled to run on the time frame specified.