원문 : 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
!