attivato il controlllo della due date per invio ftp
This commit is contained in:
@@ -38,6 +38,7 @@ my $ftp_passwd;
|
||||
my $ftp_parm;
|
||||
my $ftp_filename;
|
||||
my $ftp_target;
|
||||
my $duedate;
|
||||
my ($unit_id, $unit, $unittype);
|
||||
my ($fileDate, $fileTime);
|
||||
my $matlab_rt = "/usr/local/MATLAB/MATLAB_Runtime/v93";
|
||||
@@ -142,7 +143,7 @@ sub trxelab {
|
||||
. " - pid $$ >> Could not connect to database: $DBI::errstr";
|
||||
|
||||
my $sth = $dbh->prepare(
|
||||
'select ftp_addrs, ftp_user, ftp_passwd, ftp_parm, ftp_filename, ftp_target from units
|
||||
'select ftp_addrs, ftp_user, ftp_passwd, ftp_parm, ftp_filename, ftp_target, duedate from units
|
||||
where id = ' . $unit_id . ';'
|
||||
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
||||
|
||||
@@ -158,6 +159,7 @@ sub trxelab {
|
||||
$ftp_parm = $results->{'ftp_parm'};
|
||||
$ftp_filename = $results->{'ftp_filename'};
|
||||
$ftp_target = $results->{'ftp_target'};
|
||||
$duedate = $results->{'duedate'};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +218,9 @@ sub trxelab {
|
||||
|
||||
print getTimeStamp("log") . " - pid $$ >> $tool ftp parm:\n" . Dumper(%ftp_parms);
|
||||
|
||||
if (($duedate eq '0000-00-00 00:00:00') or
|
||||
($duedate eq '') or
|
||||
($duedate gt getTimeStamp("db_ts") )) {
|
||||
my $ftp = Net::FTP->new( %ftp_parms )
|
||||
or die getTimeStamp("log")
|
||||
. " - pid $$ >> Cannot connect to $ftp_addrs: $@ \n";
|
||||
@@ -248,6 +253,10 @@ sub trxelab {
|
||||
$ftp->quit;
|
||||
print getTimeStamp("log")
|
||||
. " - pid $$ >> $tool: $fileelab ftp put executed.\n";
|
||||
} else {
|
||||
print getTimeStamp("log")
|
||||
. " - pid $$ >> $tool: $fileelab ftp put didn't executed because due date reached.\n";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user