powell
#!/bin/bash 
#本地日志目录
updir=/data/spms-product/443/logs
#vsftpd服务端目录位置
todir=/datalogs/spms
#find $updir -mtime +10 -name "*.*" -exec   rm -f {} \;
#find $updir -mtime +5 -name "*.log" -exec gzip {} \;
sss=`find $updir -type d -printf $todir/\'%P\n\'| awk \'{if ($0 == "")next;print "mkdir " $0}\'`
aaa=`find $updir -name "*.gz" -printf \'put %p %P \n\'`

#aaa=`find $updir -mtime +1 -name "*.gz" -printf \'put %p %P \n\'

ftp -nv 10.148.55.131 <<EOF 
user miguuser miguuser
type binary 
prompt 
$sss 
cd $todir 
$aaa 
close
bye
! 
EOF

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-07-17
  • 2022-02-23
  • 2022-01-21
猜你喜欢
  • 2021-07-30
  • 2021-08-17
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案