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

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

 #!/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