Copy the code
GameOneUpdate.sh
# / Bin / sh
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # Object: Atlantica,
# # # Function: Auto Update One GameServer's Files.
# # # Version: 1.0.0
# # # Maintainer: ZhangYinGeng
# # # Update Date: 20,090,606
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
log = Log / $ 1.log
time = `date +% F-% T`
vday = `date +% Y /% m /% d`
# # Production a bz2 update file compression package the tar cvfj game_v202_20090205.tar.bz2 ServerAgent AtlanticaDBManager
# # Cd .. / game tar cvfj game_v202_20090205.tar.bz2 *
if [$ #-lt 6]; then
echo-e "\ t $ 0 122.11.50.221 administrator oldversion newVersion [any | full] filelist"
else
ip = "$ 1"
user = "$ 2"
lver = "$ 3"
nver = "$ 4"
type = "$ 5"
filelist = "$ 6"
scp. / atgamebak.sh $ user @ $ ip: ~ /
case $ 5 in
full)
ssh-n $ user @ $ ip "mkdir-p log; ~ / atgamebak.sh $ lver $ nver $ type> log / update.log 2> & 1"
scp-r update / * $ user @ $ ip :/ cygdrive / c / ATWorld /
echo-e "$ time \ t $ ip \ t $ user \ t $ lver \ - \> $ nver \ tFull_BackUP \ tFinished" >> $ log
;;
any)
scp $ filelist $ user @ $ ip: ~ /
ssh-n $ user @ $ ip "mkdir-p log; ~ / atgamebak.sh $ lver $ nver $ type $ filelist> log / update.log 2> & 1"
scp-r update / * $ user @ $ ip :/ cygdrive / c / ATWorld /
echo-e "$ time \ t $ ip \ t $ user \ t $ lver \ - \> $ nver \ tAny_BackUP \ tFinished" >> $ log
;;
*)
echo-e "\ t $ 0 122.11.50.221 administrator oldversion newVersion [any | full] filelist"
echo-e "$ time \ t $ ip \ t $ user \ t $ lver \ - \> $ nver \ tError \ tFailed" >> $ log
;;
esac
fi