In the sales I purchased a large Western Digital external HDD. I don't really
trust hard disks anymore, but all other options are uneconomical or equally
untrustworthy, so it's all I have for now. At least it's guaranteed. Anyway I
face some troubles when backing up. I had to use gdisk
to create the GPT
partition instead of parted
, for reasons I can't really fathom, but I'll
probably stick with gdisk
until further notice now.
After repartitioning the new drive the next task was to consolidate 2
generations worth of backup data onto it. I usually stick with rsync -aPv
to
mirror file trees. I copied all the data from both generations into
subdirectories on the same disk. However, it also contains several complete
Linux filesystems with archived copies of /sys
, /proc
, /run
, and other
data that I don't really care about.
rsync -aPv
expands to rsync -rlptgoDPv
. -D
is not really wanted, though;
it's an abbreviation for --devices
and --specials
, which we don't want.
However, all other options we want. We want to be able to do all operations as
a regular user. Although some files are sensitive, the backups live in a
privileged space, so perhaps we don't care too much about security within the
space itself. In this case we can do chmod -R o+rX /tree
. This uses X
for
"special execute" which will make directories world-executable while not
affecting the status of the execute bit for files. It will also make everything
world-readable which obviously comes with heavy caveats.
We can add the -u
or --update
option to the rsync command, this will
overwrite identically named files in the tree with newer versions from the
source. Obviously this does have the potential to lose data, but it may be a
reasonable trade-off to make the filesystem more manageable; YMMV. As we're not
using --delete
the target tree will essentially be an accretion of files;
files that get moved will potentially create duplicates. We consider this an OK
trade off relative to the dangers of using --delete
.
You can use the --log-file=foo.log
option to store all progress to a log file
which you can examine afterward. You'll want to vet the transfer reasonably
carefully to make sure everything completed and you're not deleting potentially
valuable things.