[nos-bbs] log triggers & shell scripts
Andrew
k1ymi at k1ymi.com
Tue Mar 11 06:16:54 EDT 2025
Maiko,
OH of course! I made the assumption there would be a matching time in
the log. Which now I think about it, that depends when the script is
ran. doh!
I'll tail the logfile instead of trying to match times.
Thanks for the help.
Andrew - K1YMI
On Mon, Mar 10 2025 at 09:12:40 PM -05:00:00, maiko at pcsinternet.ca
wrote:
> Hi Andrew,
>
> It's your awk statement. IF the start does not find a direct matching
> time entry, then nothing is generated, period. If I run the awk
> manually
> at the command line and make sure to specify a starttime in the
> logfile,
> then it dumps the full email. For example :
>
> Here is the tail end of a logfile on my backup system :
>
> 19:47:22 CONSOLE - ax25 h all +h > archive.heard.txt
> 19:53:40 - socket 137 has vanished
> 19:55:11 - AT command: source bcteensy.nos+|2290+
> [snip]
> 20:44:49 - socket 137 has vanished
> 20:45:15 - AT command: ax25 h save+|2308+
> 20:50:20 - socket 137 has vanished
> 20:53:51 - socket 137 has vanished
> 20:55:15 - AT command: source bcteensy.nos+|2304+
> 20:55:15 - AT command: source report.nos+|2309+
> 20:55:16 - AT command: ax25 h save+|2310+
> 20:55:20 - AT command: source bcninotnc.nos+|2307+
>
> I run the awk portion of your script at the command line, direct to
> stdout,
> omitting the output file, just for testing :
>
> bash-5.1# awk -v start="19:51" -v end="20:58" '$0 ~ start, $0 ~
> end' \
> /life/ve4klm/jnos/rte/logs/10Mar25
>
> NOTHING
>
> If I use start="19:47" instead, then BINGO, we get output :
>
> 19:47:22 CONSOLE - ax25 h all +h > archive.heard.txt
> 19:53:40 - socket 137 has vanished
> 19:55:11 - AT command: source bcteensy.nos+|2290+
> 19:55:11 - AT command: source report.nos+|2295+
> [snip]
>
> Also, I had to add +X permission to your sh file and on my
> jnos I have to run it as sh ./last10mins.sh, since '.' is
> not in the path, no big deal.
>
> Maiko
>
>>>> I am trying to fire off a shell script on a log trigger event, but
>>>> the script does not seem to execute.
>>>> I believe permissions are correct and it's executable. It also
>>>> runs fine when ran manually from command line under the same user
>>>> as JNOS.
>>>> Even if I try and run a 'shell ./shell_script.sh from the JNOS
>>>> admin console it does not seem to execute.
>>>> Is there a specific directory shell scripts should be in?
>>>>
>>>> Andrew - K1YMI
>> _______________________________________________
>> nos-bbs mailing list
>> nos-bbs at lists.tapr.org <mailto:nos-bbs at lists.tapr.org>
>> <http://lists.tapr.org/mailman/listinfo/nos-bbs_lists.tapr.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/nos-bbs_lists.tapr.org/attachments/20250311/7da19449/attachment.htm>
More information about the nos-bbs
mailing list