본문 바로가기

리눅스

[리눅스] FTP 업로드 스크립트

728x90

FTP 업로드 스크립트

vim ftp.sh
#!/bin/sh

DATE=`date -d today +%Y%m%d`

#relay3.scbyun.com
#relay4.scbyun.com
#relay5.scbyun.com
#relay6.scbyun.com
#relay7.scbyun.com
#relay8.scbyun.com
#relay9.scbyun.com
#relay10.scbyun.com

SERVER_LIST="
relay2.scbyun.com
"

USER='xman'
PASSWD='dusrnth2001'
FILE='$DATE*.log'
#for SERVER in ${SERVER_LIST}
#do

ftp -vn $SERVER_LIST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
bi
ha
cd /var/slogs
lcd /data/newlog/$SERVER_LIST
prompt
mget $FILE
quit

END_SCRIPT

#done

 

vim ftp_upload.sh
#!/bin/bash

ftp -vn << END
open IP or DOMAIN
user ID "PASSWD"
bin
hash
put UPLOAD_FILENAME
quit

 

참고URL

- ftp 업로드 스크립트 : https://scbyun.com/41

 

728x90