[nos-bbs] log triggers & shell scripts
maiko at pcsinternet.ca
maiko at pcsinternet.ca
Mon Mar 10 22:12:40 EDT 2025
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
> http://lists.tapr.org/mailman/listinfo/nos-bbs_lists.tapr.org
More information about the nos-bbs
mailing list