#!/bin/bash

cd /usr/local
DAY=`date +%Y%m%d`
tar zcvf key-${DAY}.tar key/
FTPSERVER='10.86.6.15'
FTPUSER=deve
FTPPASSWORD='devetest001'
FTPDIR='/devetest'
LOCALDIR='/usr/local'

cd $LOCALDIR

ftp -ivn<<!
open $FTPSERVER
user $FTPUSER $FTPPASSWORD
passive
cd $FTPDIR
mput key-${DAY}.tar
#rm -rf /usr/local/key-${DAY}.tar
bye
!
rm -rf /usr/local/key-${DAY}.tar