On a sunny day (Tue, 7 Aug 2018 10:04:06 +0000 (UTC)) it happened Martin
Gregorie wrote in :
>Similarly, I use two USB 2.5" hard drives (currently a pair of 375GB WD
>Blue hard drives) to take weekly backups. This is mild paranoia: I use
>two, rotated in sequence, so one is always offline in a firesafe and so
>fairly safe from damage.
>
>However, IMO the key trick is using rsync to do the backups. Its fast
>because it always does the minimum work needed to make a full backup: it
>only copies files and directories that have changed to the backup disk
>and removes files from the backup that have been deleted from the disk
>being backed up. The firdst backup to a hew disk is always slow because
>everything is backed up: subsequent backups can be 20-30 times faster
>depending on how much has changed/
>
>There is a related program, rsnapshot, that preserves deleted files, but
>I haven't used it. I think it works like this: like rsync, it initially
>makes a full backup as the base snapshot and then preserves a set of
>snapshots, with the files and directories in each being either a copy of
>a file that changed or a symlink the most recent backed-up copy.
>
>Either of these is probably faster than using dd for backups and is
>certainly much faster than using an archiver such as tar (with or without
>compression), zip, lharc, etc.
I use a backup script per program code I work on.
You can use cp -urp if you want recursive.
Only use mkdir the first time to create the directories on the target device
after checking it was really mounted,
else it can leave you in the illusion you are copying to some device,
while it actually copied to local directories created on /mnt/...
mount /dev/sdg1 /mnt/sdg1
##mkdir -p /mnt/sdg1/compile/pantel/weather_sensor > /dev/zero
cp -up * /mnt/sdg1/compile/pantel/weather_sensor/
df
sync
umount /dev/sdg1
echo
df
Takes only a second to run, say with an formatted USB stick in /dev/sdg
That is level 1 backup.
I do that every time I add a new feature to the code, or write a lot of code.
Very useful as you can get old working code back if you get some strange errors
with the new code.
sdg is in this case the USB stick I always carry with me.
The dd thing for the whole raspi image I only do every now and then, sometimes
with month in between,
sometimes days if a lot was changed or a lot was added with apt-get.
I have similar scripts for email backup in /root/mail/ (I use pine).
The result is that my emails are still all nicely organized and go back to 1998
on this system (been using pine since then),
same for Usenet as I wrote the reader...
And easy to search for anything in /root/mail with grep...
So much faster....
Simplicity.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|