Informatica Housekeeping or Move or Archive Files Which are Older than 30 days

By mallik034vismobang09 Feb 20204 min read
Informatica Housekeeping or Move or Archive files which are older than 30 days

As a admin you have to do housekeeping activity frequently and which is tedious. In fact developers runs thousands of Informatica jobs every day and each jobs are creating lots log files like sessions logs and workflow logs and many other logs files.


We need to clean these logs files regularly and cleaning of these log file manually is time taking and need lots efforts.


This blogs explain you how smartly you can do this housekeeping activity.


Below the shell script which will do Housekeeping or Move or Archive files which are older than 30 days.

ods_archive.sh #!/bin/ksh
#===============================================================================================#
# Name          : ods_archive.sh                                                                #
# Written by    : Mallik                                                                        #
# Purpose       : Move files which are older than 30 days                                       #
# Pending       : NONE                                                                          #
# Creation Date : 09-FEB-2019                                                                   #
# Version       : 1                                                                             #
# ==============================================================================================#
TODAY_DATE=`date +%d%m%Y_%H%M%S`


ARCHIVE=/u01/Informatica/10.2.0/server/infa_shared/Archive


BACKUP=/u01/Informatica/10.2.0/server/infa_shared/Backup
BAD_FILES=/u01/Informatica/10.2.0/server/infa_shared/BadFiles
LKP_FILES=/u01/Informatica/10.2.0/server/infa_shared/LkpFiles
LOG=/u01/Informatica/10.2.0/server/infa_shared/log
SESS_LOGS=/u01/Informatica/10.2.0/server/infa_shared/SessLogs
SRC_FILES=/u01/Informatica/10.2.0/server/infa_shared/SrcFiles
STRORAGE=/u01/Informatica/10.2.0/server/infa_shared/Storage
TEMP=/u01/Informatica/10.2.0/server/infa_shared/Temp
TGT_FILES=/u01/Informatica/10.2.0/server/infa_shared/TgtFiles
WORKFLOW_LOGS=/u01/Informatica/10.2.0/server/infa_shared/WorkflowLogs
RECON_DATA=/u01/Informatica/10.2.0/server/infa_shared/SrcFiles/Recon_Data
REF_DATA=/u01/Informatica/10.2.0/server/infa_shared/SrcFiles/Ref_Data
INVALID=/u01/Informatica/10.2.0/server/infa_shared/SrcFiles/Ref_Data/Invalid
PROCESSED=/u01/Informatica/10.2.0/server/infa_shared/SrcFiles/Ref_Data/Processed


find $BACKUP -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $BAD_FILES -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $LKP_FILES -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $LOG -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $SESS_LOGS -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $SRC_FILES -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $STRORAGE -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $TEMP -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $TGT_FILES -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $WORKFLOW_LOGS -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $RECON_DATA -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $REF_DATA -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $INVALID -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;
find $PROCESSED -type f -mtime +30 -exec mv ‘{}’ $ARCHIVE/ \;


Regards,
Mallik

M
Mallikarjun Ramadurg

Oracle ACE Pro • Oracle SME & Founder of Vismo Technologies. Sharing practical Oracle DBA, RAC and Exadata knowledge.

1 Comment

  1. Nice Post!!
    Please Look Here At – If your Oracle database is slowing down or frequently experiencing issues, it’s time to consider a professional Oracle Database Health Check Service. At RalanTech, we specialize in delivering in-depth health checks tailored to the unique needs of your enterprise systems across the USA. Our expert team ensures your Oracle environment remains secure, efficient, and optimized.

Get the weekly Vismo digestNew Oracle articles and Q&A in your inbox. No spam.

One email a week. Unsubscribe any time.