1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
############### DOWNLOAD ###############
$sftp->setcwd($remoteStatus);
my %status_download;
for my $fstatus ($sftp->glob("$remoteStatus/*status.*", names_only => 1)){
my $fstatus_not = fileparse( $fstatus );
$status_download{$fstatus_not} = 1;
}
for my $fstatus ( glob "$lokStatus/*status.*" ) {
my $fstatus_not = fileparse( $fstatus );
$status_download{$fstatus_not} = 0;
}
my @status_download = grep { $status_download{$_} == 1 } sort keys %status_download;
$sftp->setcwd($remoteStatus);
foreach my $status_daten(@status_download) {
$status_daten="$remoteStatus/$status_daten";
$sftp->get($status_daten, $lokStatus) or die "get failed: " . $sftp->error;
}
$sftp->get($remote, $local, %options)