• Saving inbound packets

    From Alan Ianson@1:153/757 to All on Sat Jun 26 03:05:18 2021
    Hello All,

    There are times I would like to look at an inbound packet after tossing when there are unexpected errors or ???.

    Is there a way to keep inbound packets after tossing to inspect later?

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757)
  • From Oli@2:280/464.47 to Alan Ianson on Sat Jun 26 22:06:13 2021
    Alan wrote (2021-06-26):

    Hello All,

    There are times I would like to look at an inbound packet after tossing when there are unexpected errors or ???.

    Is there a way to keep inbound packets after tossing to inspect later?

    make a copy before tossing?

    ---
    * Origin: %p%s%s%s%s%n (2:280/464.47)
  • From Alan Ianson@1:153/757 to Oli on Sat Jun 26 14:19:40 2021
    Hello Oli,

    Is there a way to keep inbound packets after tossing to inspect
    later?

    make a copy before tossing?

    That's what I am doing now. What a mess of stuff.. ;)

    I am copying packets and bundles into a backup directory. A rather crude cp command. I'm not sure what is going to happen with filename collisions.

    I was thinking others may have come up with a good way to accomplish that.

    Ttyl :-),
    Al

    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757)
  • From Carlos Navarro@2:341/234.1 to Alan Ianson on Sun Jun 27 08:10:33 2021
    26 Jun 2021 14:19, you wrote to Oli:

    make a copy before tossing?

    That's what I am doing now. What a mess of stuff.. ;)

    I am copying packets and bundles into a backup directory. A rather
    crude cp command. I'm not sure what is going to happen with filename collisions.

    I was thinking others may have come up with a good way to accomplish
    that.

    Make your script create subdirectories YYYYMM (or even YYYYMMDD) and copy the files there.

    (That's how I'm doing in Windows. Sorry I cannot help with Linux ATM.)

    Carlos

    --- GoldED+/W32-MSVC 1.1.5-b20180707
    * Origin: Costa Blanca, Spain (2:341/234.1)
  • From Tommi Koivula@2:221/360 to Alan Ianson on Sun Jun 27 09:10:16 2021
    Hi Alan.

    26 Jun 21 14:19:40, you wrote to Oli:

    Is there a way to keep inbound packets after tossing to inspect
    later?

    make a copy before tossing?

    That's what I am doing now. What a mess of stuff.. ;)

    I am copying packets and bundles into a backup directory. A rather crude cp command. I'm not
    sure what is going to happen with filename collisions.

    From HPT you can use "afterunpack". But it may only be used for arcmail?

    === Cut ===
    3.2.2 AfterUnpack

    Syntax:
    afterUnpack <string>
    Example:
    afterUnpack pktpack /home/fido/in.tmp/*.pkt

    This <string> is executed after unpacking arcmail bundle. You may process your pkt files in tempInbound directory with external utility.

    This statement cannot be repeated.
    === Cut ===

    I was thinking others may have come up with a good way to accomplish that.

    I'm using exec in binkd. :)

    === Cut ===
    exec "4os2.exe /c d:\\binkd\\talteen.cmd *F *A0" *.su? *.mo? *.tu? *.we? *.th? *.fr? *.sa? *.pkt
    === Cut ===

    === Cut ===
    echo x xx:xx:xx talteen...
    set npolku=%@replace[/,_,%2]
    set npolku=%@replace[:,_,%npolku]
    set npolku=%@replace[@,_,%npolku]
    set npolku=%@replace[.,_,%npolku]
    if not exist i:\tmp\pkt\jemma\%_date%\%npolku\ md /s i:\tmp\pkt\jemma\%_date%\%npolku\
    copy /equ "%1" i:\tmp\pkt\jemma\%_date%\%npolku\
    exit
    === Cut ===

    'Tommi

    ---
    * Origin: rbb.fidonet.fi (2:221/360)
  • From Tommi Koivula@2:221/360 to Alan Ianson on Sun Jun 27 09:29:04 2021
    Hi Alan.

    26 Jun 21 14:19:40, you wrote to Oli:

    I am copying packets and bundles into a backup directory. A rather crude cp command. I'm not
    sure what is going to happen with filename collisions.

    You could set your mailer inbound to some path that your tosser does not see. Then in a tossing script first copy files to backup, then move them to your tosser inbound and make sure nothing gets overwritten.

    'Tommi

    ---
    * Origin: rbb.fidonet.fi (2:221/360)
  • From Kai Richter@2:240/77 to Alan Ianson on Sun Jun 27 12:51:58 2021
    Hello Alan!

    26 Jun 21, Alan Ianson wrote to Oli:

    That's what I am doing now. What a mess of stuff.. ;)

    It does it's job.

    I am copying packets and bundles into a backup directory. A rather
    crude cp command. I'm not sure what is going to happen with filename collisions.

    I tried many backup strategies but in the end one of my teachers was right: A file you haven't touched for 6 month will never be touched again. Well, i don't agree fully. The goal for personal data like photo gallery and videos is for a review after years. But we are talking about in-process data. It aims to protect data loss during processing failures.

    Thanks to the dupe detection of the tosser you could throw in old and new data from the backup and re-process it.

    I was thinking others may have come up with a good way to accomplish
    that.

    For tossing backups i do use a simple

    cp -au <inbound> <backup-destination>
    hpt toss

    Filename collisions will happen with nodediff files. A diff of e.g. *.a32 could be the diff 032, 132 or 232. That's why i switched to uncompressed diff backups. Because of the counter restart every year i have yearly backup directories.

    diff_path=<inbound>
    arch_path=<backup.for.diffs>
    log_file=backup.log

    # Check for yearly archive directory and create if not exist
    [ -d $arch_path/`date +%Y` ] || mkdir -p $arch_path/`date +%Y`
    cd $arch_path/`date +%Y`

    # detect nodediffs at inbound - upper lower arc
    for fdiff in $diff_path/[nN][oO][dD][eE][dD][iI][fF][fF].[aA]* ; do
    if [ -s $fdiff ] ; then
    echo `date` $fdiff >> $log_file
    arc ew $fdiff
    fi
    done

    The backquote is the magic job there. Please read "Command Substitution" in your shell manual. There is the form $(command) with a bit different behavior.

    If you want to have monthly backups check "man date" for the other format strings, there are many.

    Regards

    Kai
    --- GoldED+/LNX 1.1.4.7
    * Origin: Monobox (2:240/77)
  • From Angel Ripoll@2:341/66 to Alan Ianson on Sun Jun 27 16:45:42 2021
    Hola Alan!

    26 Jun 21 03:05, Alan Ianson dijo a All:

    There are times I would like to look at an inbound packet after tossing when there are unexpected errors or ???.

    Is there a way to keep inbound packets after tossing to inspect later?

    I do this:

    ------8<------8<----Principio de copia-paquetes.sh-----8<------8<------8< #!/bin/bash

    #####################################################################
    # Copio los paquetes que llegan para poder ver los mensajes perdidos
    #####################################################################

    echo "Empiezo a copiar paquetes"
    SECURE=/var/spool/ftn/secure
    BACKUPDIR=/srv/fido/paquetes

    pushd $BACKUPDIR

    if [ ! -d "`date +%Y`" ]; then
    mkdir `date +%Y`
    fi

    cd `date +%Y`

    if [ ! -d "`date +%m`" ]; then
    mkdir `date +%m`
    fi

    cd `date +%m`


    if [ ! -d "`date +%d`" ]; then
    mkdir `date +%d`
    fi

    cd `date +%d`

    find $SECURE -iname "*.pkt" -exec cp -p \{\} ./ \;

    for f in mo tu we th fr sa su; do
    find $SECURE -iname "*.${f}?" -exec cp -p \{\} ./ \;
    done

    popd
    ------8<------8<----Fin de copia-paquetes.sh -----8<------8<------8<

    I want you to make the copy for days. So I do not have many packages in each directory. Of course, you can shorten the directory structure :)

    I execute it before processing the mail, of course :)

    Hope this can help you

    Un saludo,
    Angel Ripoll
    aripoll @ zruspas.org

    --- GoldED+/LNX 1.1.5-b20180707 + HPT 1.9 + Binkd 1.1 en Debian
    * Origin: Synchronet - bbs.zruspas.org - Zruspa's BBS - (2:341/66)