9. 도서관/__사. Network

ftp로 파일전송하는 스크립트

행복 금융 2008. 11. 28.

#!/usr/bin/sh
#-------------------------------------------------------#
# FTP shell pgm : FTP DATA put #
# Server (UNIX) ----> FTP Server (NT) #
# mod. 2003.09.19 by kjh901@hotmail.com #
#-------------------------------------------------------#

if [ "$#" -ne 1 ]
then
echo " "
echo " usage : ftp2ftp FILENAME "
echo " "
exit
fi

if [ -e "$1" ]
then
echo "user ID PASSWD " > ./ftp2ftp_list
echo "cd /WORK " >> ./ftp2ftp_list
echo "lcd /WORK " >> ./ftp2ftp_list
echo "asc " >> ./ftp2ftp_list
echo "put $1 " >> ./ftp2ftp_list

ftp -n -v XXX.XXX.XXX.XXX < ./ftp2ftp_list
rm ./ftp2ftp_list

else
echo " "
echo " NO INPUT FILE NAME OR NO DATA !!!! "
echo " "

fi

댓글

💲 추천 글