• Copy before process..

    From Rick Smith@1:105/81 to All on Thu Sep 19 09:51:02 2024
    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
    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: Awesome Net- Oregon FTN Hub - www.awesomenet.us (1:105/81)
  • From Floris van Unen@2:280/2050 to Rick Smith on Thu Sep 19 19:27:58 2024

    Hello Rick!

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

    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?

    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


    --- GoldED+/LNX 1.1.5--b20170303
    * Origin: ----> Fidian on Azure West-Europe (Holland) IPV6. (2:280/2050)
  • From Nigel Reed@1:124/5016 to All on Thu Sep 19 15:04:59 2024
    On Thu, 19 Sep 2024 19:27:58 +0200
    "Floris van Unen" (2:280/2050) <Floris.van.Unen@f2050.n280.z2.fidonet>
    wrote:

    Hello Rick!

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

    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?

    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

    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
    --- SBBSecho 3.20-Linux
    * Origin: End Of The Line BBS - endofthelinebbs.com (1:124/5016)
  • From Jay Harris@1:229/664 to Floris van Unen on Thu Sep 19 20:09:06 2024
    On 19 Sep 2024, Floris van Unen said the following...

    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
    ===

    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

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: Northern Realms (1:229/664)
  • From Jay Harris@1:229/664 to Floris van Unen on Fri Sep 20 08:23:14 2024
    On 19 Sep 2024, Jay Harris said the following...

    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
    ===

    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!

    --- Mystic BBS v1.12 A49 2024/05/29 (Linux/64)
    * Origin: Northern Realms (1:229/664)