Target Audience: Infoworks Admins/Hadoop Admins


Problem Statement: Infoworks generates the different type of logs like hangman logs, Apricot logs, Infoworks Logs, Cube Logs etc.

Over a period of time, these files will eat up the disk space in infoworks Edge Node. To overcome this you might need to clean up the older logs based on retention policy(if any)


Solution: Please make use of the log_cleanup accordingly script provided by infoworks to overcome this problem.


You can find the log cleanup script located in the below path

$IW_HOME/apricot-meteor/scripts/log_cleanup.sh

To execute the above script, you must be sure about which folder to be chosen to for logs cleanup, start date and end date of the generated logs in those directories.

Please navigate to $IW_HOME/bin and perform source env.sh
then navigate to IW_HOME/apricot-meteor/scripts/  and perform the below command to check for options to execute the script as mentioned below.

sh log_cleanup.sh -h

This will provide the below output

****Usage****
log_cleanup.sh [arguments]
-d=<Directory path for cleanup>
-sd=<Start date(format: YYYY-MM-DD) for files to be deleted>
-ed=<End date(format: YYYY-MM-DD) for files to be deleted>

Let's assume you want to delete the logs present in the logs folder from start date 2018-01-01 to end date 20180-01-10 (jan1st to jan10th of 2018). Please use the below syntax.

Syntax:
sh log_cleanup -d=directoryname_with_complete_path -sd=YYYY-MM-DD -ed=YYYY-MM-DD

Example Usage:
sh log_cleanup.sh -d=$IW_HOME/logs/ -sd=2018-01-01 -ed=2018-01-10




Thanks,

Sri