自动上传脚本
#!/bin/bash function upload(){ ftp -n <<EOF open xx.39.248.yy 41413 user mmsftp mms123$ binary cd $2 put $1 bye EOF } for csv in *.csv do if [[ $csv == MmsActive* ]]; then upload $csv /Active elif [[ $csv == MmsSilent* ]]; then upload $csv /Silent elif [[ $csv == MmsFail* ]]; then upload $csv /Fail/${csv:16:8} else continue fi if [ $? -eq 0 ]; then rm $csv echo "uploaded $csv ok, and deleted it." >>ftp.log fi done