首页 > 代码库 > 自动上传脚本

自动上传脚本

#!/bin/bashfunction upload(){        ftp -n <<EOF        open xx.39.248.yy 41413        user mmsftp mms123$        binary        cd $2        put $1        byeEOF}for csv in *.csvdo        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        fidone

 

自动上传脚本