鸿 网 互 联 www.68idc.cn

当前位置 : 服务器租用 > 服务器相关 > 批处理 > >

文件处理脚本[游戏运维]

来源:互联网 作者:佚名 时间:2015-12-13 07:34
一个游戏公司文件处理脚本 Git SSH Secure Shell Client #!/bin/bash#game1cd /RAIDhome/game1git pullecho "game1 ok"apath=/home/username/tnt/webwww/bpath=/RAIDhome/game1/jarfile/cd /home/username/tnt/webwww/for myFile1 in CommonS.jar GateS.jar L
一个游戏公司文件处理脚本 Git SSH Secure Shell Client
 #!/bin/bash
#game1
cd /RAIDhome/game1
git pull
echo "game1 ok"
apath=/home/username/tnt/webwww/
bpath=/RAIDhome/game1/jarfile/

cd /home/username/tnt/webwww/
for myFile1 in CommonS.jar GateS.jar LoginS.jar mailS.jar TeamS.jar marketS.jar Game.jar ControlS.jar LogS.jar webwww.unity3d
do
if [ ! -f "$myFile1" ]; then
echo "no "$myFile1
else
rm -rf $bpath$myFile1
cp $apath$myFile1 $bpath
rm -rf $apath$myFile1
echo "cp "$myFile1
fi
done

read -p "refxml ? y/n: > " refxml
if [ "$refxml" == "" ];then
   echo -en "\033[32;49;1m It is empty\n"
   echo -en "\033[39;49;0m"
elif [ $refxml == 'y' ]; then
rm -rf /RAIDhome/game1/refxml
cp -R /home/file1/refxml  /RAIDhome/game1/
    echo "cp refxml"
elif [ $refxml == 'n' ]; then
    echo "no cp refxml"
else
   echo -en "\033[32;49;1m Oh no\n"
   echo -en "\033[39;49;0m"
fi
read -p "ziyuan ? y/n: > " asset
if [ "$asset" == "" ];then
   echo -en "\033[32;49;1m It is empty\n"
   echo -en "\033[39;49;0m"
elif [ $asset == 'y' ]; then
rm -rf /RAIDhome/game1/ziyuan
cp -R /home/file1/ziyuan  /RAIDhome/game1/
    echo "cp ziyuan"
elif [ $asset == 'n' ]; then
    echo "no cp ziyuan"
else
   echo -en "\033[32;49;1m Oh no\n"
   echo -en "\033[39;49;0m"
fi
cd /RAIDhome/game1
date > index.html
git add -A .
git commit -m "test "$(date +%Y-%m-%d_%H_%M)
git push origin master
echo "game1 ok"
exit 0
网友评论
<