Next revision | Previous revision |
util:pktdump [2020/03/18 18:50] – created with initial info and example wkitty42 | util:pktdump [2020/03/18 22:52] (current) – [scripting examples] more generic wkitty42 |
---|
/sbbs/exec/pktdump /sbbs/ftn/out/fidonet/*.?ut | /sbbs/exec/pktdump /sbbs/ftn/out/fidonet/*.?ut |
| |
===== scripted example ===== | ===== scripting examples ===== |
At one point in time, I had a lot of pkts that got abandoned due to a misconfiguration of my mailer. This misconfiguration resulted in the mailer not being able to access the pkt files but it could access the BSO .?lo files. When it found it could not access the pkts listed in the flo file, it deleted the flo file resulting in the pkts being abandoned. Since I didn't want that mail to be lost, I wrote a script that used pktdump to retrieve the destination addresses from the pkts and create new flo files for them. | It is possible for pkts to be abandoned when a mailer deletes .flo files without sending the pkts listed inside it. If you don't want that mail to be lost, you can use some oneliners that use pktdump to retrieve the destination addresses from the pkts and create new .flo files for them. |
| |
| First run through all the pkts and output a list of destination addresses. |
<code> | <code> |
# make a list of pkt destination addresses | # make a list of pkt destination addresses |
egrep -e "Packet Type .* from $MYFTNADDR to " | \ | egrep -e "Packet Type .* from $MYFTNADDR to " | \ |
cut -d " " -f 12 | sort -V | uniq | cut -d " " -f 12 | sort -V | uniq |
| </code> |
| |
| Now, use one of the above addresses in place of $DESTADDR and your FTN address in place of $MYFTNADDR to move all the pkts for the destination system to the /sbbs/tmp directory. |
| <code> |
# choose an address from the above list | # choose an address from the above list |
# get a list of pkts destined there and | # get a list of pkts destined there and |
cut -d " " -f 1 | tr '\n' '\0' | \ | cut -d " " -f 1 | tr '\n' '\0' | \ |
xargs -0 -n1 -i mv '{}' /sbbs/tmp | xargs -0 -n1 -i mv '{}' /sbbs/tmp |
| </code> |
| |
| Now that we have moved the pkts, lets create a .flo file with them for the destination address. Put the destination system's net number in place of $DESTNET and its node number in place of $DESTNODE. |
| <code> |
# create a flo file with the pkts | # create a flo file with the pkts |
printf "$(ls -d -1 $PWD/*.pkt | \ | printf "$(ls -d -1 $PWD/*.pkt | \ |
$(printf "%04x%04x.flo\n" $DESTNET $DESTNODE) | $(printf "%04x%04x.flo\n" $DESTNET $DESTNODE) |
</code> | </code> |
The above script snippets result in a BSO flo file being created in the current directory with a list of pkts in the temporary directory. You only need to move the flo file to the proper FTN outbound directory for the mailer to find it and send the pkts from the temporary directory. This script example helped me to recover several thousand pkts that were abandoned over night on my hub system. | |
| The above can be done a bit better by not moving the pkts to the tmp directory first but this works fine with some manual work added. Once the .flo file is created, it is a simple matter to manually move it to the proper outbound directory and wait for the mailer to transit and delete the pkts listed in it before handling the next system in the list of destinations. |
| |
| The above can be fixed up into a proper script that doesn't need to move the files at all. There should be some .bsy file creation to prevent the tosser and mailer from trying to process mail for the same system you are working with while the pkts are processed and the .flo file is created. |
| |
| These example oneliners helped a least one hub system to recover several thousand pkts that were abandoned due to a problem accessing them. |
| |
===== See Also ===== | ===== See Also ===== |