#! /usr/local/bin/perl
use strict;
use IO::File;
use Net::FTP;

my @CHECK = ("1log.gz"
            ,"2log.gz"
);

if(@CHECK){
        my $FTP = Net::FTP->new("192.168.0.1", Debug => 0) or die "Cannot connect to 192.168.0.1: $@";
        $FTP->login("hanadmin","여기엔PW를 넣습니다.") or die "Can not login \n", $FTP->message;
        my $loc = "/data01/";
        foreach my $j (0..$#CHECK){
        chomp $CHECK[$j];
        my $file = $CHECK[$j];

        $FTP->cwd($loc) or die "Cannot change working directory ", $FTP->message;
        $FTP->binary;
        $FTP->get($file,"/daum/logs/".$file) or die "$file", $FTP->message;

        }
        $FTP->quit;
}
Posted by 서오석
,