Call a script from an other script
Hi all,
I have 2 different script (SCRIPT A and SCRIPT B)
SCRIPT A is on SERVER 1 and SCRIPT B is on SERVER 2
SCRIPT A do data processing and SCRIPT B loads these data.
I need only one script instead of 2 which will process data on SERVER 1 and load them on SERVER 2 by using my 2 scripts
********************************************************
SCRIPT A on SERVER 1:
#!/bin/sh
#TIME="'date '+%Y%m%d''"
HOST='10.171.16.30'
USER='qosuser'
PASSWD='qos1user'
./npa_ParseAndLoadObject_CELLCCHDR.sh
./npa_ParseAndLoadObject_CELTCHF.sh
./npa_ParseAndLoadObject_CELTCHH.sh
./npa_ParseAndLoadObject_CLSDCCH.sh
./npa_ParseAndLoadObject_CLTCH.sh
cd /export/home/qosuser/MISC/results/
#cd pmexport_$TIME
ftp -n ${HOST} << EOF
user ${USER} ${PASSWD}
cd /export/home/qosuser/MISC/results
prompt n
mput CELLCCHDR.sgw
mput CELTCHH.sgw
mput CELTCHF.sgw
mput CLTCH.sgw
mput CLSDCCH.sgw
bye
EO
**********************************************
SCRIPT B on SERVER 2:
! /bin/ksh
#########################################################################
# $ID : npa_RadioKPI_LoadObject.sh
# Author: Karamoko MAMADOU, QoS Engineer for Moov CI
# Date : 2013/03/08
#
#
# Change history
#========================================================================
# Load only Object parsed fron oldossserver and transfered by ftp
#########################################################################
INPUTDIR="$HOME/MISC/results"
DBDIR="/opt/mysql/mysql/data/radio_kpis"
SGWDIR="$HOME/MISC/resultsSGW"
TIME="'date '+%Y%m%d%H%M%S''"
# Backup File to a folder
cp "${INPUTDIR}/CELLCCHDR.sgw" ${SGWDIR}/CELLCCHDR_$TIME.sgw
# Copy File to be loaded into mysql import folder prior for loading into database
cp "${INPUTDIR}/CELLCCHDR.sgw" ${DBDIR}/cellcchdr.csv
# Import data into database in specified table
cd $DBDIR
mysqlimport --user=pmdbuser --password=pmdbuser1 -r -s --fields-terminated-by=";" --lines-terminated-by="\n" radio_kpis cellcchdr.cs
*********************************************************************
Need help
Thx
I have 2 different script (SCRIPT A and SCRIPT B)
SCRIPT A is on SERVER 1 and SCRIPT B is on SERVER 2
SCRIPT A do data processing and SCRIPT B loads these data.
I need only one script instead of 2 which will process data on SERVER 1 and load them on SERVER 2 by using my 2 scripts
********************************************************
SCRIPT A on SERVER 1:
#!/bin/sh
#TIME="'date '+%Y%m%d''"
HOST='10.171.16.30'
USER='qosuser'
PASSWD='qos1user'
./npa_ParseAndLoadObject_CELLCCHDR.sh
./npa_ParseAndLoadObject_CELTCHF.sh
./npa_ParseAndLoadObject_CELTCHH.sh
./npa_ParseAndLoadObject_CLSDCCH.sh
./npa_ParseAndLoadObject_CLTCH.sh
cd /export/home/qosuser/MISC/results/
#cd pmexport_$TIME
ftp -n ${HOST} << EOF
user ${USER} ${PASSWD}
cd /export/home/qosuser/MISC/results
prompt n
mput CELLCCHDR.sgw
mput CELTCHH.sgw
mput CELTCHF.sgw
mput CLTCH.sgw
mput CLSDCCH.sgw
bye
EO
**********************************************
SCRIPT B on SERVER 2:
! /bin/ksh
#########################################################################
# $ID : npa_RadioKPI_LoadObject.sh
# Author: Karamoko MAMADOU, QoS Engineer for Moov CI
# Date : 2013/03/08
#
#
# Change history
#========================================================================
# Load only Object parsed fron oldossserver and transfered by ftp
#########################################################################
INPUTDIR="$HOME/MISC/results"
DBDIR="/opt/mysql/mysql/data/radio_kpis"
SGWDIR="$HOME/MISC/resultsSGW"
TIME="'date '+%Y%m%d%H%M%S''"
# Backup File to a folder
cp "${INPUTDIR}/CELLCCHDR.sgw" ${SGWDIR}/CELLCCHDR_$TIME.sgw
# Copy File to be loaded into mysql import folder prior for loading into database
cp "${INPUTDIR}/CELLCCHDR.sgw" ${DBDIR}/cellcchdr.csv
# Import data into database in specified table
cd $DBDIR
mysqlimport --user=pmdbuser --password=pmdbuser1 -r -s --fields-terminated-by=";" --lines-terminated-by="\n" radio_kpis cellcchdr.cs
*********************************************************************
Need help
Thx
A voir également:
- Call a script from an other script
- Script vidéo youtube - Guide
- Ghost script - Télécharger - Polices de caractères
- Mas script - Accueil - Windows
- Script cmd - Guide
- Win setup from usb - Télécharger - Utilitaires