¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 56°Ç
   
FTP ¾÷·Îµå (mput)
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2011-03-23 (¼ö) 16:03 Á¶È¸ : 9159
±ÛÁÖ¼Ò :
                          

FTP ¾÷·Îµå ½ºÅ©¸³Æ®ÀÔ´Ï´Ù.
 - ÇÏÀ§ µð·ºÅ丮¸¦ Æ÷ÇÔÇؼ­ ¿Ã¸®¸ç ¿©·¯ ftp »çÀÌÆ®¿¡ ¼Ò½º¸¦ ¿Ã¸®´Â ¹æ¹ýÀÔ´Ï´Ù.
 #!/bin/bash
 
NUM=76  # ½ÃÀÛ¾ÆÀÌÇÇ
END_NUM=81  # ¸¶Áö¸· ¾ÆÀÌÇÇ
NET=115.xx.xx
USER=xxxxxx
PW=xxxxx
path=/home/webhosting/web1_backup
echo "start " > /root/ip.log
 
### upload-list ¿¡´Â Æú´õ¸®½ºÆ® ÁöÁ¤
cat upload-list |while read a ; do
    if [ $NUM -ge $END_NUM ] ; then
    exit
    else
    IP=$NET.$NUM
    cd $path/$a
    find  -type d > directory.list   # ÇÏÀ§µð·ºÅ丮 È®ÀÎ
    echo "$IP   /   $path/$a " >> /root/ip.log
 
### ftp ¾÷·Îµå
        for subdir in `cat directory.list`
            do
            ftp -n $IP << EOF
            open ${IP}
            user ${USER} ${PW}
            bi
            prom
            mkdir ${subdir}
            cd ${subdir}
            lcd ${subdir}
            mput *
EOF
    done

    let NUM=$NUM+1
rm -f directory.list
    fi
done
 
 

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.