---
title: "ftp perl"
author: "maxer025"
date: "2018-11-13T15:50:50Z"
tags: []
categories: ["开源软件"]
slug: "ftp-perl"
draft: false
lastmod: "2018-11-13T15:50:50Z"
id: 2433760
url: "https://maxer025.iteye.com/blog/2433760"
---

#!/usr/bin/perl -w
use strict;
use File::Copy qw(copy);
use Net::FTP;

my ($starttime, $endtime);

   my $server = "10.20.28.9";
   my $remote_drv_ltr = "/Public/RMS/RMS_BCKP/";
   my $login = "admin";
   my $passwd = "arr**2500";
   my $REPOSITORY_DIR = "/Public/RMS/RMS_BCKP/";
   
  
   my $ftp = Net::FTP->new("10.20.28.9", Debug => 0)
      or die "Cannot connect to some.host.name: $@";
    $ftp->login($login ,$passwd)
      or die "Cannot login ", $ftp->message;
    $ftp->cwd($remote_drv_ltr)
      or die "Cannot change working directory ", $ftp->message;
    $ftp->binary();
    $ftp->put("c:/rmsdata/TestFtp.pl",$REPOSITORY_DIR."LOG/testFTP.pl")
      or die "put failed ", $ftp->message;
    $ftp->quit;
    print $ftp->message;