shell---两句命令打造FTP上传文件夹
#!/bin/bash sss=`find /root/sk -type d -printf ‘%P\n‘| awk ‘{if ($0 == "")next;print "mkdir " $0}‘` aaa=`find /root/sk -type f -printf ‘put %p %P \n‘` ftp -nv 127.0.0.1 <<EOF user kabc kabc type binary prompt $sss $aaa quit EOF
sss=`find /root/sk -type d -printf ‘%P\n‘| awk ‘{if ($0 == "")next;print "mkdir " $0}‘`
aaa=`find /root/sk -type f -printf ‘put %p %P \n‘`
#!/bin/bash updir=/root/sk todir=sk sss=`find $updir -type d -printf $todir/‘%P\n‘| awk ‘{if ($0 == "")next;print "mkdir " $0}‘` aaa=`find $updir -type f -printf ‘put %p %P \n‘` ftp -nv 127.0.0.1 <<EOF user kabc kabc type binary prompt $sss cd $todir $aaa quit EOF
#!/bin/bash updir=/root/sk #要上传的文件夹 todir=sk #目标文件夹 ip=127.0.0.1 #服务器 user=leo #ftp用户名 password=123456 #ftp密码 sss=`find $updir -type d -printf $todir/‘%P\n‘| awk ‘{if ($0 == "")next;print "mkdir " $0}‘` aaa=`find $updir -type f -printf ‘put %p %P \n‘` ftp -nv $ip <<EOF user $user $password type binary prompt $sss cd $todir $aaa quit EOF
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。