Easy and Cheap SoHo Backups
Jeanne & The Darlings - How Can You Mistreat The One You Love
I've got a backup management tool set to write. I'll post it when I've got something written and implemented.
I have a small-ish NAS. I currently do nightly Read-Only backups to another NAS stored at a friend's house. Every so often I'll do a "destructive" (Copy & Delete) backup to clean up any files I've deleted or moved since there would be two copies on the target. I only run that when I'm reasonably sure things are "good" on the main device.
My new plan involves a second off-site backup and will give me an effective 2 month backup retention period.
I accidentally not only lunch some directory on January 12 then I have until March to notice and get it back. Site-A got fully up to date on January 1 and got only new items until Jan 31 . On Feb 1 it will hibernate as Device-B takes over nightly backups.
As long as I catch the problem before March 1 when Site-A goes active again, the files will exist on one backup device or the other. I will make daily alerts around this so I notice changes in directory sizes.
This should also help with any potential filesystem corruption as well since I'll be comparing filesizes I'm going to check each CD, TV Box Set and Movie I own for changes every day. If the size changes or the file no longer exists, alert on them so I can follow up.
There's nothing stopping me from doing:
# To avoid working with unpredictably formatted text I'm
# using the checksum of the directory name to store the
# directory size info. Everything is easier that way.for directory in ($list of directories to check)
do
sum_name=$(echo "$directory | shasum)
dirsize_cur=$(du --max-depth=1 $directory)
dirsize_prev=$(grep the directory-size file for $sum_name, return the first field, which will be the size in bytes or whatever)if ( $dirsize_cur doesn't equal $dirsize_prev)
then
diff today's directory listing to yesterdays, dump the output to an email and alert me of all changes.
fi
done
Then just add a step to the tools I use to manage my files so that when I copy or delete anything I can update the sizes for the changed directories.
Doing "du --max-depth=1" against my top level TV shows directory only takes 5 seconds and I can just grab each size result out of that output.
The fly in this ointment is going to be any directories my wife touches and their .DS_STORE man nonsense.
- adminx's blog
- Log in to post comments
- 96 reads
