Browse Source

自動執行連線並上傳檔案到FTP server,適用於ubuntu18.04

fatwolf 2 years ago
parent
commit
92d8a7b1d5
1 changed files with 17 additions and 0 deletions
  1. 17 0
      testftp.sh

+ 17 - 0
testftp.sh

@@ -0,0 +1,17 @@
+#!/bin/sh
+HOST=192.168.50.108
+USER=backupftp
+PASSWD=0000
+FILE=ub1.log
+ 
+ftp -v -n $HOST <<END_SCRIPT
+user $USER $PASSWD
+binary
+hash
+cd /files
+lcd /home/gs1801/wolf/testftp/
+prompt
+put $FILE
+bye
+END_SCRIPT
+echo "commit to ftp successfully"