#!/bin/bashFTP_IP=127.0.0.1FTP_USER="aaa"FTP_PSW="bbb"GAME_NAME="ccc"cd /data/ftp_dirtar zcvf action.tar.gz logs/*VAR_FULL_MD5=`md5sum action.tar.gz|cut -d ' ' -f1`VAR_MD5=${VAR_FULL_MD5:12:8}YESTERDAY_STRING=`date '+%Y%m%d' -d '-1day'`TAR_NAME=${GAME_NAME}'_action_'${YESTERDAY_STRING}_${VAR_MD5}.tar.gzecho ${TAR_NAME}mv action.tar.gz ${TAR_NAME}ftp -n ${FTP_IP} << EOFuser ${FTP_USER} ${FTP_PSW}binarypromptmput *.gz*closequitEOFmv -f *.gz* ../ftp_dir_old/