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)