. ~/.profile
############################## # FTP Data files ##############################
#remote dir REMOTEDIR="/home/cheyang/"
#local dir LOCALDIR="/ftphome/cheyangsend/"
LOCALDIR_BAK="/ftphome/cheyangsend/bak/"
year=`date +%Y` month=`date +%m` nowdate=`expr $year$month` echo $nowdate
#Filename: yyyymm+subsid.txt #like C2B2016031499300042426334.* FILENAME=`expr "C2B"$nowdate"*"` echo $FILENAME
###############################
echo "Begin to send file to remote dir"
if [ ! -d "$LOCALDIR_BAK" ];then mkdir "$LOCALDIR_BAK" echo "mkdir successful." fi
ftp -nv 10.32.227.129 <<! user username userpasswd
bin pass prompt off
lcd $LOCALDIR cd $REMOTEDIR mput $FILENAME !mv $FILENAME $LOCALDIR_BAK
bye !
#echo "Disconect to ftp service."
echo "Complete!!!" exit 0
################################