Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
PARAMS_FILE /export/home/migdev1/conf/irmigration.ctx
DISCARD_FILE_DIR /export/home/migdev1/log/discard
ERROR_FILE_DIR /export/home/migdev1/log/error
LOG_FILE_DIR /export/home/migdev1/log
REJECT_FILE_DIR /export/home/migdev1/log/reject
export PARAMS_FILE="$HOME/conf/irmigration.ctx"
/bin/bash $1_run.sh --context_param PARAMS_FILE=$PARAMS_FILE
*** A000_Migration_Master Version 1.0.0.12 as of 23/10/2012: Start Migration ...
*** LOG_FILE_DIR = /export/home/migdev2/log
*** REJECT_FILE_DIR = /export/home/migdev2/log/reject
*** DISCARD_FILE_DIR = /export/home/migdev2/log/discard
*** ERROR_FILE_DIR = /export/home/migdev2/log/error
***
*** Subjob called by masterjob, outputs with tJava.System.out.println():
***
/export/home/migdev1/conf/irmigration.ctx (Permission denied)
*** A0005_Display_Configuration: current actual context
*** ---------------------------------------------------
*** Runtime context parameters
*** ---------------------------------------------------
*** PARAMS_FILE = /export/home/migdev1/conf/irmigration.ctx
*** ---------------------------------------------------
*** DISCARD_FILE_DIR = /export/home/migdev1/conf/irmigration.ctx/logs/discard
*** ERROR_FILE_DIR = /export/home/migdev1/logs/error
*** LOG_FILE_DIR = /export/home/migdev1/logs
*** REJECT_FILE_DIR = /export/home/migdev1/logs/reject
*** ---------------------------------------------------
./conf -> config file
./log -> log files in subdir structure
./bin -> shell scripts
#!/bin/bash
# ---------------------------------------------------------------------------------
# Name : run.sh
# Purpose : extract and run TALEND jobs from ZIP archives
# Author : sse/tjo
# Version : see below
# Date : see below
# Comment : none
# ---------------------------------------------------------------------------------
export VERSION=1.0.0.12
export STAND=24/10/2012
export LOG_FILE_DIR=$HOME/log
cd $HOME
# ---------------------------------------------------------------------------------
echo
echo
echo ">>> run.sh: Version $VERSION as of $STAND"
# ---------------------------------------------------------------------------------
# Test: Parameter 1 = Talend Job name : must not be null
# ---------------------------------------------------------------------------------
if
then
echo ">>> usage: run.sh TALENDJOB"
exit -1
fi
cd ~/jobs
# ---------------------------------------------------------------------------------
# Unpack archive
# ---------------------------------------------------------------------------------
if
then
echo ">>> run.sh: auto extract $1 archive ... "
rm -rf $1_0.1
unzip -u -qq $1_0.1.zip
fi
# ---------------------------------------------------------------------------------
# Check if TALEND run script exists
# ---------------------------------------------------------------------------------
if
then
echo ">>> No shell script $1_0.1/$1/$1_run.sh found."
exit -1;
fi
echo ">>> run.sh: running $1_0.1/$1/$1_run.sh"
echo
# ---------------------------------------------------------------------------------
# Run script
# ---------------------------------------------------------------------------------
cd $1_0.1/$1
datum=`date +'20%y%m%d-%H%M%S'`
# link the config and log directories from $HOME down to the jobs work directory
rm -rf ./conf ./log ./data
ln -s $HOME/conf .
ln -s $HOME/log .
ln -s $HOME/data .
/bin/bash $1_run.sh 2>&1 | tee $LOG_FILE_DIR/run-$datum.log
echo
echo ">>> Done."
# ---------------------------------------------------------------------------------
# End of file run.sh
# ---------------------------------------------------------------------------------