separazione dell'ftp fissata

This commit is contained in:
2020-12-25 19:12:20 +01:00
parent d5bcd7988d
commit de8a7d1b92
2 changed files with 17 additions and 4 deletions

View File

@@ -24,7 +24,6 @@ my ( @CSVData, @sql );
my $outcount = 0;
my $outfilenum = 0;
my $maxsqllines = 10000;
my $csv_x_ftp_dir = '/home/asega/.csv_x_ftp';
my (
$tool, $toolbatt, $tooltemp, $tooltype, @channels,
@NewData, @ain, @din, @nodetype, $GDEventDate
@@ -52,6 +51,8 @@ my $from = 'ASE Alert System<alert@aseltd.eu>';
my ( $email_msg, $email_obj );
my $G201_fcheck = 0;
my $D2W_fcheck = 0;
my $FtpToCustomerCmd = 'SendFtpElabData.pl';
my ( $scriptname, $scriptpath );
sub getTimeStamp
{ # parm [ts] => timestamp for filename; log => timestamp for log
@@ -161,6 +162,15 @@ sub matlabCalc {
}
sub trxelab {
my $user = getpwuid($>);
my $ftpcmd = "$scriptpath$FtpToCustomerCmd -m \"$matlab_timestamp\" -u $unit -t $tool >> /home/$user/log/loadcsvdata.log 2>&1";
print getTimeStamp("log")
. " - pid $$ >> Fork FTP command to set GID mysql: $ftpcmd.\n";
exec('/usr/bin/sg', 'mysql', "$ftpcmd");
}
sub trxelab_old {
my $dbh =
DBI->connect( "DBI:mysql:$db_lar;host=$server", $username, $password )
or die getTimeStamp("log")
@@ -486,6 +496,8 @@ GetOptions(
open FILE, $filename
or die( "Error: opening input file " . $filename . "\n" );
( $scriptname, $scriptpath ) = fileparse($0);
if ( $db_name ne 'asega' ) {
$db_name =~ s/aseu/dbn/;
$db_sp = $db_name;