脚本收藏
时间:2006-05-31 来源:ghbspecial
启动服务
cat service.sh
#!bin/sh
/etc/..../apachectl start
su - wdxc /site/jboss/bin/run.sh &&
su - oracle /usr/local/syscmf/oracle.sh && cat /usr/local/mf/oracle.sh
lsnrctl start
expect /usr/local/mf/oracle.exp
cat oracle.exp #!/usr/local/bin/expect
#oracle run scripts
set timeout 60
spawn sqlplus \/nolog
set timeout 60
expect "SQL\>"
set timeout 60
send "conn \/ as sysdba\r"
set timeout 360
expect "SQL\>"
send "startup\r"
set timeout 60
expect "SQL\>"
send "exit\r"
exit mail send cat mailsend.sh #! /bin/bash READPATH="./mail"
for FILE in $READPATH/*
do
if [ -f "$FILE" ];then
if [ -r "$FILE" ];then
if [ -s "$FILE" ];then
LINECOUNT=0
CONTENT=""
read EMAILS SUBJECT < $FILE
while read LINE;do
if [ $LINECOUNT -eq 0 ];then
let LINECOUNT=$LINECOUNT+1
continue
fi
echo $LINE >> ./content.txt
done < $FILE
echo $EMAILS | awk -F"," '{ for(i=0;i<NF;i++){
system("mail "$i" -s '"$SUBJECT"' < ./content.txt")
}}'
fi
fi
fi
done
#!bin/sh
/etc/..../apachectl start
su - wdxc /site/jboss/bin/run.sh &&
su - oracle /usr/local/syscmf/oracle.sh && cat /usr/local/mf/oracle.sh
lsnrctl start
expect /usr/local/mf/oracle.exp
cat oracle.exp #!/usr/local/bin/expect
#oracle run scripts
set timeout 60
spawn sqlplus \/nolog
set timeout 60
expect "SQL\>"
set timeout 60
send "conn \/ as sysdba\r"
set timeout 360
expect "SQL\>"
send "startup\r"
set timeout 60
expect "SQL\>"
send "exit\r"
exit mail send cat mailsend.sh #! /bin/bash READPATH="./mail"
for FILE in $READPATH/*
do
if [ -f "$FILE" ];then
if [ -r "$FILE" ];then
if [ -s "$FILE" ];then
LINECOUNT=0
CONTENT=""
read EMAILS SUBJECT < $FILE
while read LINE;do
if [ $LINECOUNT -eq 0 ];then
let LINECOUNT=$LINECOUNT+1
continue
fi
echo $LINE >> ./content.txt
done < $FILE
echo $EMAILS | awk -F"," '{ for(i=0;i<NF;i++){
system("mail "$i" -s '"$SUBJECT"' < ./content.txt")
}}'
fi
fi
fi
done
相关阅读 更多 +