[arm-allstar] Archive Directory Filename Customization

Doug Crompton wa3dsp at gmail.com
Thu Feb 1 12:43:28 EST 2018


John,

 If you use the script I proposed you probably would want to use a mv (move
command) instead of cp (copy). I believe you would want to move the files
from the current directory after you change the name to avoid confusion.
archivedir will continue to write files in the source directory and
executing the script again will just bring those additional files over.
You also can change the output filenames to whatever format you desire by
changing the script. To keep them in sortable order though you need to keep
it in the current order.

https://stackoverflow.com/questions/17819834/sortable-readable-and-standard-time-format-for-logs


*73 Doug*

*WA3DSP*

*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*



On Thu, Feb 1, 2018 at 12:06 PM, "John Huggins via arm-allstar" <
arm-allstar at hamvoip.org> wrote:

> Thanks Doug. I do so love "Bash"ing and that's a good method you propose.
>
> Will set it up and give it a go tonight.
>
> John
>
> On Thu, Feb 1, 2018 at 11:59 AM, "Doug Crompton via arm-allstar" <
> arm-allstar at hamvoip.org> wrote:
>
>> John,
>>
>>  We will take that into consideration but Linux has great tools to do
>> this in so many ways externally. Here is an example:
>>
>> I created dummy files in /tmp/test as such:
>>
>> ls /tmp/test
>>
>> 20180130055931.wav  20180130055951.wav  20180130060111.wav
>> 20180130060131.wav
>> 20180130055941.wav  20180130060101.wav  20180130060121.wav
>>
>> Then ran the below script and had the resultant files -
>>
>>  ls /tmp/test2
>>
>> 01-30-2018-05-59-31.wav  01-30-2018-05-59-51.wav
>> 01-30-2018-06-01-11.wav  01-30-2018-06-01-31.wav
>> 01-30-2018-05-59-41.wav  01-30-2018-06-01-01.wav  01-30-2018-06-01-21.wav
>>
>> Of course the format could be changed to whatever you want by changing
>> the script.
>>
>> #!/bin/bash
>>
>> FILES=/tmp/test
>> DestFiles=/tmp/test2
>>
>> for f in $FILES/*
>> do
>>   #echo "Processing $f file..."
>>   # take action on each file. $f store current file name
>>   f=${f##*/}
>>   ext="${f##*.}"
>>   dt="${f%.*}"
>>
>>   yr=${dt:0:4}
>>   mn=${dt:4:2}
>>   dy=${dt:6:2}
>>
>>   hr=${dt:8:2}
>>   mi=${dt:10:2}
>>   se=${dt:12:2}
>>
>>   echo "Filename $dt.$ext changed to $mn-$dy-$yr-$hr-$mi-$se.$ext"
>>   cp $FILES/$dt.$ext $DestFiles/$mn-$dy-$yr-$hr-$mi-$se.$ext
>>
>> done
>>
>>
>>
>> *73 Doug*
>>
>> *WA3DSP*
>>
>> *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
>>
>>
>>
>> On Thu, Feb 1, 2018 at 7:24 AM, "John Huggins via arm-allstar" <
>> arm-allstar at hamvoip.org> wrote:
>>
>>> Thanks for the response Doug. Comments below.
>>>
>>> On Wed, Jan 31, 2018 at 11:43 PM, "Doug Crompton via arm-allstar"
>>> <arm-allstar at hamvoip.org> wrote:
>>> > John,
>>> >
>>> >   Let me correct what I said as it was probably confusing the way I
>>> wrote
>>> > it...  The node number is appended to the path.
>>>
>>> Yeah I did know that, but didn't make it clear. Sorry about that.
>>>
>>> > You cannot change the
>>> > filename.
>>>
>>> How sad. Well please consider this a feature request. All I really
>>> hope for is a dash between the YYYYMMDD and the Time. This...
>>>
>>>   20180130055931.WAV
>>>
>>> ...to this...
>>>
>>>   20180130-055931.WAV
>>>
>>> Why? When parsing through all these files during an investigation it
>>> really helps to quickly be able to note the time at a glance rather
>>> than having to parse it in one's head continuously.
>>>
>>> That said, the scorecard for this feature is pretty good. Two days
>>> after turning it on and evidence of unwelcome behavior presented to an
>>> individual who voluntarily removed himself from the scene, we now have
>>> one less whacker on our system... and the women are trickling back to
>>> the repeater already!
>>>
>>> Allstar/HamVOIP... making a difference... thanks!
>>>
>>> John
>>>
>>> >
>>> > 73 Doug
>>> > WA3DSP
>>> > http://www.crompton.com/hamradio
>>> >
>>> >
>>> > On Wed, Jan 31, 2018 at 11:39 PM, Doug Crompton <wa3dsp at gmail.com>
>>> wrote:
>>> >>
>>> >> John,
>>> >>
>>> >>  The filename is always the node number. So in your example if you had
>>> >> that define in node [40000] the file name would be
>>> >>
>>> >> /media/USB/40000
>>> >>
>>> >> If you had a second node and it was [40001] the filename would be
>>> >>
>>> >> /media/USB/40001
>>> >>
>>> >> In other words you can define the path but not the file name.
>>> >>
>>> >> 73 Doug
>>> >> WA3DSP
>>> >> http://www.crompton.com/hamradio
>>> >>
>>> >>
>>> >>
>>> >> On Wed, Jan 31, 2018 at 10:28 PM, "John Huggins via arm-allstar"
>>> >> <arm-allstar at hamvoip.org> wrote:
>>> >>>
>>> >>> All,
>>> >>>
>>> >>> When we make use of the archive feature by setting rpt.conf to
>>> this...
>>> >>>
>>> >>>   archivedir = /media/USB
>>> >>>
>>> >>> ...where is the setting to customize the filename format?
>>> >>>
>>> >>> Thanks.
>>> >>>
>>> >>> 73
>>> >>> John, kx4o
>>> >>> _______________________________________________
>>> >>>
>>> >>> arm-allstar mailing list
>>> >>> arm-allstar at hamvoip.org
>>> >>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>> >>>
>>> >>> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>> >>
>>> >>
>>> >
>>> >
>>> > _______________________________________________
>>> >
>>> > arm-allstar mailing list
>>> > arm-allstar at hamvoip.org
>>> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>> >
>>> > Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>> _______________________________________________
>>>
>>> arm-allstar mailing list
>>> arm-allstar at hamvoip.org
>>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>>
>>> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>>
>>
>>
>> _______________________________________________
>>
>> arm-allstar mailing list
>> arm-allstar at hamvoip.org
>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>
>> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>
>
>
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20180201/ad9fa170/attachment-0001.html>


More information about the arm-allstar mailing list