ftp自动上传shell

FTP地址:192.168.209.128

用户名:test

密码:test123

上传的文件:test.tgz

  
  
  
  
  1. [root@shell ~/shell]# cat autoftp.sh 
  2. #!/bin/bash 
  3.  
  4. shopts -s -o nounset 
  5.  
  6. Filename="test.tgz" 
  7. HOST="192.168.209.128" 
  8. USER="test" 
  9. PASS="test123" 
  10.  
  11. cd /root 
  12.  
  13. ftp -n $HOST <<AUTOEOF 
  14. quote USER $USER 
  15. quot PASS $PASS 
  16.  
  17. put $Filename 
  18.  
  19. quit 
  20.  
  21. AUTOEOF 

 

你可能感兴趣的:(shell,ftp,职场,休闲,自动上传)