#!/bin/bash
#################################################################################
# File_Name : imauanzstmtfilearchv.prog #
# DESCRIPTION : File Archiving using Shell programming(HOST) #
# : #
# PROCESS FLOW : After processing a data file We can use this program #
# to move the processed file to archive directory #
# #
# Parameters : $5 = SOURCE_DIR_PATH #
# $6 = SOURCE_FILE_NAME #
# $7 = ARCHIVE_DIR_PATH #
# $8 = ARCHIVE_FILE_NAME #
# $9 = ARCH_PATH #
# ===================================================================== #
# CREATE/MODIFICATION HISTORY #
# ===========+====================+==================================== #
# DATE |NAME |DETAILS #
# ===========+====================+==================================== #
#################################################################################
TODAY=$(date)
HOST=$(hostname)
echo "---------------------------------------------------------------------"
echo " Started Date, Time : $TODAY "
echo " Host:$HOST "
echo "---------------------------------------------------------------------"
echo "====================================================================="
echo " Program To MOVE a file from one dir to other dir"
echo "====================================================================="
#######################################################################
# Standard parameters
APPS_LOGIN=$1
USER_ID=$2
USER_NAME=$3
REQ_ID=$4
SOURCE_DIR=/interface/servername/INSTANCE/outgoing/COUNTRY
DESTINATION_DIR=/interface/server/INSTANCE/outgoing/COUNTRY/ARCHIVE
# Custom parameters
SOURCE_DIR_PATH=$5
SOURCE_FILE_NAME=$6
ARCHIVE_DIR_PATH=$7
ARCHIVE_FILE_NAME=$8
echo `pwd`
#Display Parameters
echo Request ID is $REQ_ID
echo User Name $USER_NAME
echo User id $USER_ID
echo Source Directory Path is $SOURCE_DIR_PATH
echo Source File Name $SOURCE_FILE_NAME
echo Archive Directory Path is $ARCHIVE_DIR_PATH
echo Archived File Name $ARCHIVE_FILE_NAME
cd $SOURCE_DIR
echo `pwd`
if [ -f $SOURCE_DIR_PATH/$SOURCE_FILE_NAME ]
then
mv $SOURCE_DIR_PATH/$SOURCE_FILE_NAME $ARCHIVE_DIR_PATH/$ARCHIVE_FILE_NAME
# rm $SOURCE_DIR_PATH/$SOURCE_FILE_NAME
echo Source file $SOURCE_DIR_PATH/$SOURCE_FILE_NAME has been moved to $ARCHIVE_DIR_PATH/$ARCHIVE_FILE_NAME
else
echo " Source File Archiving Failed, File NOT FOUND, Check DIR or File name "
fi
echo "******** Host Program Execution completed *************"
# end of script
#################################################################################
# File_Name : imauanzstmtfilearchv.prog #
# DESCRIPTION : File Archiving using Shell programming(HOST) #
# : #
# PROCESS FLOW : After processing a data file We can use this program #
# to move the processed file to archive directory #
# #
# Parameters : $5 = SOURCE_DIR_PATH #
# $6 = SOURCE_FILE_NAME #
# $7 = ARCHIVE_DIR_PATH #
# $8 = ARCHIVE_FILE_NAME #
# $9 = ARCH_PATH #
# ===================================================================== #
# CREATE/MODIFICATION HISTORY #
# ===========+====================+==================================== #
# DATE |NAME |DETAILS #
# ===========+====================+==================================== #
#################################################################################
TODAY=$(date)
HOST=$(hostname)
echo "---------------------------------------------------------------------"
echo " Started Date, Time : $TODAY "
echo " Host:$HOST "
echo "---------------------------------------------------------------------"
echo "====================================================================="
echo " Program To MOVE a file from one dir to other dir"
echo "====================================================================="
#######################################################################
# Standard parameters
APPS_LOGIN=$1
USER_ID=$2
USER_NAME=$3
REQ_ID=$4
SOURCE_DIR=/interface/servername/INSTANCE/outgoing/COUNTRY
DESTINATION_DIR=/interface/server/INSTANCE/outgoing/COUNTRY/ARCHIVE
# Custom parameters
SOURCE_DIR_PATH=$5
SOURCE_FILE_NAME=$6
ARCHIVE_DIR_PATH=$7
ARCHIVE_FILE_NAME=$8
echo `pwd`
#Display Parameters
echo Request ID is $REQ_ID
echo User Name $USER_NAME
echo User id $USER_ID
echo Source Directory Path is $SOURCE_DIR_PATH
echo Source File Name $SOURCE_FILE_NAME
echo Archive Directory Path is $ARCHIVE_DIR_PATH
echo Archived File Name $ARCHIVE_FILE_NAME
cd $SOURCE_DIR
echo `pwd`
if [ -f $SOURCE_DIR_PATH/$SOURCE_FILE_NAME ]
then
mv $SOURCE_DIR_PATH/$SOURCE_FILE_NAME $ARCHIVE_DIR_PATH/$ARCHIVE_FILE_NAME
# rm $SOURCE_DIR_PATH/$SOURCE_FILE_NAME
echo Source file $SOURCE_DIR_PATH/$SOURCE_FILE_NAME has been moved to $ARCHIVE_DIR_PATH/$ARCHIVE_FILE_NAME
else
echo " Source File Archiving Failed, File NOT FOUND, Check DIR or File name "
fi
echo "******** Host Program Execution completed *************"
# end of script
Oracle Fusion HCM Online Training
ReplyDeleteOracle Fusion SCM Online Training
Oracle Fusion Financials Online Training
Big Data and Hadoop Training In Hyderabad