SFTP로 자동 업로드/다운로드 스크립트
2018.04.04 17:25
원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어
Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
원문 : http://www.ischo.net -- 조인상 //시스템 엔지니어
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/bash
DATE=`date '+%Y%m%d'`
PORTNUMBER='22'
FTP_USER='SSHUSER'
FTP_PASS='SSHPASSWORD'
SFTPSERVER='sftp://sftp_server_ip_address'
FTP_DEST='FTP server's directory'
DEST='local directory'
lftp -p ${PORTNUMBER} -u ${FTP_USER},${FTP_PASS} ${SFTPSERVER} << !
cd ${FTP_DEST}
lcd ${DEST}
mput home_${DATE}.tar.gz
mget *.gz
quit
!