2015-01-27 5 views
-1

나는 내가 해당 파일 같은 errror을 얻거나 당신은이 점에서 도움이 directory.can하고 구문을한 호스트에서 다른 호스트로 디렉토리를 복사하는 방법은 무엇입니까?

my $src_path="/abc/xyz/123/"; 
my $BASE_PATH="https://stackoverflow.com/a/b/c/d/"; 
my $scpe = Net::SCP::Expect->new(host=> $host, user=>$username, password=>$password); 
$scpe->scp -r($host.":".$src_path, $dst_path); 

을 다음과 같이 시도 SCP 사용하여 다른 호스트로 하나의 호스트에서 디렉토리를 복사 할.

답변

0

맨 페이지에 나와있는 예에 따르면, 이미 옵션으로 전달한 경우 호출 할 때 호스트를 반복하지 않아도됩니다. http://search.cpan.org/~djberg/Net-SCP-Expect-0.12/Expect.pm에서

:이 "-r"오타 게다가

Example 2 - uses constructor, shorthand scp: 

my $scpe = Net::SCP::Expect->new(host=>'host', user=>'user', password=>'xxxx'); 

$scpe->scp('file','/some/dir'); # 'file' copied to 'host' at '/some/dir' 

입니까? 재귀 적으로 복사하려면 옵션 해시에 recursive => "yes"를 설정해야합니다.

+0

고맙습니다. –