diff --git a/agc_2-X/trunk/bin/AST_CRON_mix_recordings.pl b/agc_2-X/trunk/bin/AST_CRON_mix_recordings.pl index 7df290af..ccb10390 100644 --- a/agc_2-X/trunk/bin/AST_CRON_mix_recordings.pl +++ b/agc_2-X/trunk/bin/AST_CRON_mix_recordings.pl @@ -31,6 +31,7 @@ # 51122-1458 - Added soxmix binary path check # 60318-0921 - Added ability to mix gsm audio files # 60807-1308 - Modified to use /etc/astguiclient.conf for settings +# 71004-1124 - Changed to not move ORIG recordings if FTP server does not Ping # @@ -133,21 +134,21 @@ foreach(@FILES) if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; - if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - if (!$T) - { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - ### BEGIN Remote file transfer $p = Net::Ping->new(); $ping_good = $p->ping("$FTP_host"); if ($ping_good) { + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} + if (!$T) + { + `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; + `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + $ftp = Net::FTP->new("$FTP_host", Port => 21); $ftp->login("$FTP_user","$FTP_pass"); $ftp->cwd("$FTP_dir"); diff --git a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_GSM.pl b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_GSM.pl index a4d95720..020e8deb 100644 --- a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_GSM.pl +++ b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_GSM.pl @@ -31,6 +31,7 @@ # 51021-1058 - Added quotes around CLI executed commands # 51122-1455 - Added soxmix and sox binary path check # 60807-1308 - Modified to use /etc/astguiclient.conf for settings +# 71004-1124 - Changed to not move ORIG recordings if FTP server does not Ping # @@ -144,42 +145,42 @@ foreach(@FILES) if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; - if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - if (!$T) - { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - else - { - `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - - `$soxbin "$dir1/DONE/$ALLfile" "$dir1/DONE/$GSMfile"`; - - if (!$T) - { - `rm -f "$dir1/DONE/$ALLfile"`; - } - - if($DB){print STDERR "\n|/usr/bin/sox $live_folder/$filename[$k]$WAV $arch_folder/$filename[$k]$GSM|\n";} - chmod 0755, "$dir1/DONE/$GSMfile"; - ### BEGIN Remote file transfer - # $p = Net::Ping->new(); - # $ping_good = $p->ping("$FTP_host"); + $p = Net::Ping->new(); + $ping_good = $p->ping("$FTP_host"); + + if ($ping_good) + { + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} + if (!$T) + { + `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; + `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + else + { + `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + + `$soxbin "$dir1/DONE/$ALLfile" "$dir1/DONE/$GSMfile"`; + + if (!$T) + { + `rm -f "$dir1/DONE/$ALLfile"`; + } + + if($DB){print STDERR "\n|/usr/bin/sox $live_folder/$filename[$k]$WAV $arch_folder/$filename[$k]$GSM|\n";} + chmod 0755, "$dir1/DONE/$GSMfile"; - # if ($ping_good) - # { $ftp = Net::FTP->new("$FTP_host", Port => $FTP_port, Debug => 0, Passive => 1); $ftp->login("$FTP_user","$FTP_pass"); $ftp->cwd("$FTP_dir"); $ftp->binary(); $ftp->put("$dir1/DONE/$GSMfile", "$GSMfile"); $ftp->quit; - # } + } ### END Remote file transfer } diff --git a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3.pl b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3.pl index 127c0147..88d09137 100644 --- a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3.pl +++ b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3.pl @@ -32,6 +32,7 @@ # 51122-1455 - Added soxmix and sox binary path check # 60616-1027 - Modified to convert to MP3 format # 60807-1308 - Modified to use /etc/astguiclient.conf for settings +# 71004-1124 - Changed to not move ORIG recordings if FTP server does not Ping # @@ -145,42 +146,43 @@ foreach(@FILES) if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; - if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - if (!$T) - { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - else - { - `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - - `$lamebin -b 16 -m m --silent "$dir1/DONE/$ALLfile" "$dir1/DONE/$MP3file"`; - - if (!$T) - { - `rm -f "$dir1/DONE/$ALLfile"`; - } - - if($DB){print STDERR "\n|/usr/bin/sox $live_folder/$filename[$k]$WAV $arch_folder/$filename[$k]$GSM|\n";} - chmod 0755, "$dir1/DONE/$MP3file"; - ### BEGIN Remote file transfer - # $p = Net::Ping->new(); - # $ping_good = $p->ping("$FTP_host"); + $p = Net::Ping->new(); + $ping_good = $p->ping("$FTP_host"); + + if ($ping_good) + { + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} + + `$lamebin -b 16 -m m --silent "$dir1/$ALLfile" "$dir1/$MP3file"`; + + if($DB){print STDERR "\n|/usr/bin/sox $live_folder/$filename[$k]$WAV $arch_folder/$filename[$k]$GSM|\n";} + chmod 0755, "$dir1/DONE/$MP3file"; - # if ($ping_good) - # { $ftp = Net::FTP->new("$FTP_host", Port => $FTP_port, Debug => 0, Passive => 1); $ftp->login("$FTP_user","$FTP_pass"); $ftp->cwd("$FTP_dir"); $ftp->binary(); $ftp->put("$dir1/DONE/$MP3file", "$MP3file"); $ftp->quit; - # } + + if (!$T) + { + `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; + `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + else + { + `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + if (!$T) + { + `rm -f "$dir1/DONE/$ALLfile"`; + } + + } ### END Remote file transfer } diff --git a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3_DATE.pl b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3_DATE.pl index d926fc2d..567bb024 100644 --- a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3_DATE.pl +++ b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_MP3_DATE.pl @@ -44,6 +44,7 @@ # 60616-1027 - Modified to convert to MP3 format # - Creates Directory on target FTP server based on . # 60807-1308 - Modified to use /etc/astguiclient.conf for settings +# 71004-1124 - Changed to not move ORIG recordings if FTP server does not Ping # #verbose @@ -163,33 +164,33 @@ foreach(@FILES) $MP3file = $ALLfile; $MP3file =~ s/-all\.wav/-all.mp3/gi; - if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - - `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; - if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} - if (!$T) - { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - else - { - `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; - } - - `$lamebin -b 16 -m m --silent "$dir1/DONE/$ALLfile" "$dir1/DONE/$MP3file"`; - - - if($DB){print STDERR "\n|$lamebin -b 16 -m m --silent \"$dir1/DONE/$ALLfile\" \"$dir1/DONE/$MP3file\"\n";} - chmod 0755, "$dir1/DONE/$MP3file"; - ### BEGIN Remote file transfer - # $p = Net::Ping->new(); - # $ping_good = $p->ping("$FTP_host"); + $p = Net::Ping->new(); + $ping_good = $p->ping("$FTP_host"); + + if ($ping_good) + { + if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} + + `$soxmixbin "$dir1/$INfile" "$dir1/$OUTfile" "$dir1/$ALLfile"`; + if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} + if (!$T) + { + `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; + `mv -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + else + { + `cp -f "$dir1/$ALLfile" "$dir1/DONE/$ALLfile"`; + } + + `$lamebin -b 16 -m m --silent "$dir1/DONE/$ALLfile" "$dir1/DONE/$MP3file"`; + + + if($DB){print STDERR "\n|$lamebin -b 16 -m m --silent \"$dir1/DONE/$ALLfile\" \"$dir1/DONE/$MP3file\"\n";} + chmod 0755, "$dir1/DONE/$MP3file"; - # if ($ping_good) - # { $ftp = Net::FTP->new("$FTP_host", Port => $FTP_port, Debug => ($v? 1 : 0), Passive => 1); $ftp->login("$FTP_user","$FTP_pass"); #$ftp->cwd("$FTP_dir"); @@ -198,18 +199,17 @@ foreach(@FILES) $ftp->binary(); $ftp->put("$dir1/DONE/$MP3file", "$MP3file"); $ftp->quit; - # } - ### END Remote file transfer - - # clean up - if (!$T) - { - `rm -f "$dir1/ORIG/$INfile"`; - `rm -f "$dir1/ORIG/$OUTfile"`; - `rm -f "$dir1/DONE/$ALLfile"`; - `rm -f "$dir1/DONE/$MP3file"`; - } + # clean up + if (!$T) + { + `rm -f "$dir1/ORIG/$INfile"`; + `rm -f "$dir1/ORIG/$OUTfile"`; + `rm -f "$dir1/DONE/$ALLfile"`; + `rm -f "$dir1/DONE/$MP3file"`; + } + } + ### END Remote file transfer } } $i++; diff --git a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_VDonly_DATE.pl b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_VDonly_DATE.pl index 43d96d13..8231fc65 100644 --- a/agc_2-X/trunk/bin/AST_CRON_mix_recordings_VDonly_DATE.pl +++ b/agc_2-X/trunk/bin/AST_CRON_mix_recordings_VDonly_DATE.pl @@ -30,6 +30,7 @@ # 60318-0921 - Added ability to mix gsm audio files # 60807-1308 - Modified to use /etc/astguiclient.conf for settings # 70702-1139 - Removed mixing, and added dated folder storage on FTP server +# 71004-1124 - Changed to not move ORIG recordings if FTP server does not Ping # # Customize variables for FTP @@ -155,19 +156,18 @@ foreach(@FILES) $ftp->binary(); $ftp->put("$dir1/$INfile", "$ALLfile"); $ftp->quit; + + $stmtA = "UPDATE recording_log set location='$HTTP_path/$start_date/$ALLfile' where recording_id='$recording_id';"; + if($DB){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n"; + + if (!$T) + { + `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; + `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; + } } ### END Remote file transfer - - $stmtA = "UPDATE recording_log set location='$HTTP_path/$start_date/$ALLfile' where recording_id='$recording_id';"; - if($DB){print STDERR "\n|$stmtA|\n";} - $affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n"; - - if (!$T) - { - `mv -f "$dir1/$INfile" "$dir1/ORIG/$INfile"`; - `mv -f "$dir1/$OUTfile" "$dir1/ORIG/$OUTfile"`; - } - } } $i++;