From 33beb9bb2e3cc55cdc0105cac6aaa898fe522059 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 22 Jul 2016 16:03:04 +0000 Subject: [PATCH] Added --nodatedir option to AST_VDsaes_export.pl script git-svn-id: svn://192.168.202.10@2564 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/AST_VDsales_export.pl | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/agc_2-X/trunk/bin/AST_VDsales_export.pl b/agc_2-X/trunk/bin/AST_VDsales_export.pl index 0c0dbcc9..cc21a874 100644 --- a/agc_2-X/trunk/bin/AST_VDsales_export.pl +++ b/agc_2-X/trunk/bin/AST_VDsales_export.pl @@ -1,13 +1,13 @@ #!/usr/bin/perl # -# AST_VDsales_export.pl version: 2.8 +# AST_VDsales_export.pl version: 2.12 # # This script is designed to gather sales for a VICIDIAL Outbound-only campaign and # post them to a directory # # /usr/share/astguiclient/AST_VDsales_export.pl --campaign=GOODB-GROUP1-GROUP3-GROUP4-SPECIALS-DNC_BEDS --output-format=fixed-as400 --sale-statuses=SALE --debug --filename=BEDSsaleMMDD.txt --date=yesterday --email-list=test@gmail.com --email-sender=test@test.com # -# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 # # CHANGES # 61219-1118 - First version @@ -33,6 +33,7 @@ # 130406-2146 - Added --email-post-audio # 130811-0902 - Added wget HTTP auth options and added more debug output # 140403-1603 - Added --skip-rec-xtra option to not perform additional recording lookups beyond vicidial_id +# 160722-1140 - Added --nodatedir option # $txt = '.txt'; @@ -64,6 +65,8 @@ $INtalkmin=0; $email_post_audio=0; $http_user=''; $http_pass=''; +$NODATEDIR = 0; # Don't use dated directories for audio (default) +$YEARDIR = 1; # put dated directories in a year directory first $secX = time(); $time = $secX; @@ -182,6 +185,7 @@ if (length($ARGV[0])>1) print " [--ftp-login=XXXXXXXX] = FTP user\n"; print " [--ftp-pass=XXXXXXXX] = FTP pass\n"; print " [--ftp-dir=XXXXXXXX] = remote FTP server directory to post files to\n"; + print " [--nodatedir] = do not put into dated directories\n"; print " [--with-transfer-audio] = Different method for finding audio, also grabs transfer audio filenames\n"; print " [--skip-rec-xtra] = Do not perform additional recording lookups beyond vicidial_id\n"; print " [--temp-dir=XXX] = If running more than one instance at a time, specify a unique temp directory suffix\n"; @@ -455,6 +459,11 @@ if (length($ARGV[0])>1) $T=1; $TEST=1; print "\n----- TESTING -----\n\n"; } + if ($args =~ /--nodatedir/i) + { + $NODATEDIR=1; + if ($DB) {print "\n----- NO DATE DIRECTORIES -----\n\n";} + } if ($args =~ /--email-list=/i) { @data_in = split(/--email-list=/,$args); @@ -879,15 +888,15 @@ if ( (length($Ealert)>5) && (length($email_list) > 3) ) # $VARREPORT_pass = 'test'; # $VARREPORT_dir = ''; -$NODATEDIR = 0; # Don't use dated directories for audio -$YEARDIR = 1; # put dated directories in a year directory first - if ($ftp_transfer > 0) { + $FTPdb=0; + if ($DBX>0) {$FTPdb=1;} + use Net::FTP; - if (!$Q) {print "Sending File Over FTP: $outfile\n";} - $ftp = Net::FTP->new("$VARREPORT_host", Port => $VARREPORT_port); + if (!$Q) {print "Sending File Over FTP: $outfile ($VARREPORT_user @ $VARREPORT_host)\n";} + $ftp = Net::FTP->new("$VARREPORT_host", Port => $VARREPORT_port, Debug => "$FTPdb"); $ftp->login("$VARREPORT_user","$VARREPORT_pass"); $ftp->cwd("$VARREPORT_dir"); $ftp->put("$PATHweb/vicidial/server_reports/$outfile", "$outfile");