Page 1 of 1

recording into month folders

PostPosted: Mon Oct 15, 2018 9:15 am
by Op3r
Hi,

I seems to be forgetting how it was done, but I think the recordings can be sort out via folders using this command:

/usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3 --file-sorting ?

However do I need to add more on that file sorting variable? will it sort the recordings according to month?

Re: recording into month folders

PostPosted: Mon Oct 15, 2018 9:33 am
by dspaan
There is a script that does exactly that but only for dispo's that have the sale flag turned on.

perl AST_VDsales_export.pl --help
allowed run time options:
[--date=YYYY-MM-DD] = date override
[--hour-offset=X] = print datetime strings with this hour offset
[--filename=XXX] = Name to be used for file, variables: YYYY=year, MM=month, DD=day, HH=hour, II=minute, SS=second
[--campaign=XXX] = Campaign that sales will be pulled from
[--without-camp=XXX] = Campaign that will be excluded from ALL
[--sale-statuses=XXX-XXY] = Statuses that are deemed to be "Sales". Default SALE
NOTE: To include all statuses in the export, use "--sale-statuses=---ALL---"
[--output-format=XXX] = Format of file. Default "pipe-standard"
[--with-inbound=XXX-XXY] = include the following inbound groups
[--without-in=XXX-XXY] = inbound groups that will be excluded from ALL
[--calltime=XXX] = filter results to only include those calls during this call time
[--outbound-calltime-ignore] = for outbound calls ignores call time
[--totals-only] = print totals of time and calls only
[--ftp-transfer] = Send results file by FTP to another server
[--ftp-audio-transfer] = Send associated audio files to FTP server, dated directories
[--ftp-norun] = Stop program when you get to the FTP transfer
[--ftp-server=XXXXXXXX] = FTP server to send file to
[--ftp-login=XXXXXXXX] = FTP user
[--ftp-pass=XXXXXXXX] = FTP pass
[--ftp-dir=XXXXXXXX] = remote FTP server directory to post files to
[--with-transfer-audio] = Different method for finding audio, also grabs transfer audio filenames
[--with-did-lookup] = Looks up the DID pattern and name the call came in on if possible
[--email-list=test.com:test2.com] = send email results to these addresses
[--email-sender=vicidial] = sender for the email results
[--quiet] = quiet
[--test] = test
[--debug] = debugging messages
[--debugX] = Super debugging messages

format options:
pipe-standard|csv-standard|tab-standard|pipe-triplep|pipe-vici|html-rec|fixed-as400|tab-QMcustomUSA|tab-SCcustomUSA



Example:

perl /usr/share/astguiclient/AST_VDsales_export.pl --campaign=CSSALE-DCAPTURE-DFOLLOW --sale-statuses=SALE-DMSALE-AWSALE --with-inbound=DCSAFE-DCAPTUREIN-DFOLLOWIN --ftp-transfer --ftp-audio-transfer --ftp-server=xxx.xxx.xxx.xxx --ftp-login=xxxxxx --ftp-pass=xxxxxxxx --ftp-dir=/mnt/folder/vicidial_backups/project1/sales --debugX

Re: recording into month folders

PostPosted: Mon Oct 15, 2018 10:31 am
by Op3r
I dont think this will sort the recordings to months.

Re: recording into month folders

PostPosted: Mon Oct 15, 2018 10:44 am
by williamconley
Breaking down by month is possible, but you'll need to modify the ftp perl script I believe. Shouldn't really be too difficult since the system already creates a folder which includes the month (and year and date). Everything necessary is already in the perl script.

It's also not necessary. Any file handling you need to accomplish can already be managed by "2018-10-*" which will apply to the entire month of October without having an actual single folder for October. That wild card will apply to all the daily folders for October.

So the question is ... why do you need "months" specifically?

Re: recording into month folders

PostPosted: Mon Oct 15, 2018 11:23 am
by dspaan
Op3r wrote:I dont think this will sort the recordings to months.


I remember using the script and it organized the recordigs in folders, thought it was months and then a subfolder with days but it's been a long time since i used it. Just test it?

Re: recording into month folders

PostPosted: Mon Oct 15, 2018 4:29 pm
by blackbird2306
There is no need to add more than "--file-sorting". Sorting is not by month, but by day.
Code: Select all
[--file-sorting] = sort files into subfolders in YYYY-MM-DD format (THIS WILL NOT ALLOW FTP ARCHIVING)

if ($FILESORT) {$location = "$location$file_date/";}
$location = compression method MP3, GSM, OGG...
$file_date = e.g. 2018-10-15
means for MP3 directory: MP3/2018-10-15

Re: recording into month folders

PostPosted: Tue Oct 16, 2018 12:49 pm
by Op3r
cool stuff

thanks