Discussion:
Copy before process..
(too old to reply)
Rick Smith
2024-09-19 06:51:02 UTC
Permalink
Hello All!

I am trying to track down an error from a downlink... How would I copy pkts
before process? Is in the main-in script I use or ? I believe it has to be when
binkd receives and before hpt tosses?

Regards,

Rick

... i enjoy bbsing
Floris van Unen
2024-09-19 16:27:58 UTC
Permalink
Hello Rick!

19 Sep 24 09:51, you wrote to all:

RS> Hello All!

RS> I am trying to track down an error from a downlink... How would I copy
RS> pkts before process? Is in the main-in script I use or ? I believe it
RS> has to be when binkd receives and before hpt tosses?

I got my binkd to copy anything that it receives before it gets tossed. In the
binkd config i added:

===
# Run an external program.
# The "!" before program pathname means immediate program execution
# after receiving the file.
# ***
# Macros: *F - complete name of received file,
# *H - remote hostname or IP,
#
exec "/path/to/archiver.sh *F *H" *
===

and the archiver.sh script is
===
#!/bin/bash

Y=`date '+%Y'`
W=`date '+%V'`
B=`basename $1`
L=/path/to/archive/$Y/$W
mkdir -p $L
cp -vf $1 $L/$2_$B
===

This gives me an archive folder per year and in there per week of the incoming
packets prefixed with the hostname where they came from.

enjoy,
Floris
Jay Harris
2024-09-19 17:09:06 UTC
Permalink
On 19 Sep 2024, Floris van Unen said the following...

Fv> and the archiver.sh script is
Fv> ===
Fv> #!/bin/bash
Fv>
Fv> Y=`date '+%Y'`
Fv> W=`date '+%V'`
Fv> B=`basename $1`
Fv> L=/path/to/archive/$Y/$W
Fv> mkdir -p $L
Fv> cp -vf $1 $L/$2_$B
Fv> ===

Thanks for this.

This worked well for my IPv4 nodes but not for the IPv6 ones. I made a
modification that uses their first AKA instead:

In binkd.conf:
exec "!/path/to/archiver.sh *F *A0" *

===
#!/bin/bash
Y=`date '+%Y'`
W=`date '+%V'`
B=`basename $1`
L=/path/to/archive/$Y/$W
N=`echo $2 | tr ":/@." "----"`

mkdir -p $L
cp -vf $1 $L/$N\_$B
===

This will name the files like this:
1-229-426-fidonet_41801563.PKT
21-3-0-fsxnet_0008a828.pkt
618-618-1-micronet_00DA0000.TH6


Jay

... Dachshunds are really small crocodiles with fur
Jay Harris
2024-09-20 05:23:14 UTC
Permalink
On 19 Sep 2024, Jay Harris said the following...

JH> This worked well for my IPv4 nodes but not for the IPv6 ones. I made a
JH> modification that uses their first AKA instead:
JH>
JH> In binkd.conf:
JH> exec "!/path/to/archiver.sh *F *A0" *
JH>
JH> ===
JH> #!/bin/bash
JH> Y=`date '+%Y'`
JH> W=`date '+%V'`
JH> B=`basename $1`
JH> L=/path/to/archive/$Y/$W
JH> N=`echo $2 | tr ":/@." "----"`
JH>
JH> mkdir -p $L
JH> cp -vf $1 $L/$N\_$B
JH> ===

And if you'd like to automatically clean up these files, you can add this to
your daily or weekly maintenance:

# Delete all files older than 30 days
find /path/to/archive/ -type f -mtime +30 -execdir rm -- '{}' \;

# Remove all empty directories
find /path/to/archive/ -empty -type d -delete


Jay

... What do 150 Smurfs do at a football game? The Blue Wave!

Nigel Reed
2024-09-19 12:04:59 UTC
Permalink
On Thu, 19 Sep 2024 19:27:58 +0200
Post by Floris van Unen
Hello Rick!
RS> Hello All!
RS> I am trying to track down an error from a downlink... How would
RS> I copy pkts before process? Is in the main-in script I use or ?
RS> I believe it has to be when binkd receives and before hpt
RS> tosses?
I got my binkd to copy anything that it receives before it gets
===
# Run an external program.
# The "!" before program pathname means immediate program execution
# after receiving the file.
# ***
# Macros: *F - complete name of received file,
# *H - remote hostname or IP,
#
exec "/path/to/archiver.sh *F *H" *
===
and the archiver.sh script is
===
#!/bin/bash
Y=`date '+%Y'`
W=`date '+%V'`
B=`basename $1`
L=/path/to/archive/$Y/$W
mkdir -p $L
cp -vf $1 $L/$2_$B
===
This gives me an archive folder per year and in there per week of the
incoming packets prefixed with the hostname where they came from.
enjoy,
Floris
Nice script. it's a shame someone didn't do something like that the day
fidonet started. It would be a great archive to have.
--
End Of The Line BBS - Plano, TX
telnet endofthelinebbs.com 23
Loading...