TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: Alan Ianson
from: Kai Richter
date: 2021-06-27 12:51:00
subject: Saving inbound packets

Hello Alan!

26 Jun 21, Alan Ianson wrote to Oli:

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

It does it's job.

 AI> I am copying packets and bundles into a backup directory. A rather
 AI> crude cp command. I'm not sure what is going to happen with filename
 AI> 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.

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

For tossing backups i do use a simple

cp -au  
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=
arch_path=
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)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.