A Backup Strategy That Does Not Suck (opens in new tab)

theonlyblogever.com·12w·Open original (opens in new tab)

Here’s my new backup strategy. It uses luks, cryptsetup and rsync.

Note: This post is very Linux command-line heavy.

This is a continuing series about operating a home server. Part 1 (HDD) of the saga is here. Part 2 (ZFS) can be found here. Part 3 (GPU) is found here. Part 4 (KVM) is here. Part 5 (L2ARC Cache) is here.

Remember, 3-2-1: 3 copies, on 2 different physical mediums, with 1 offsite copy. Rsync to the rescue!

How else would I save my collection of precious cat pictures from certain disaster?

Currently, my offsite backup is an 8 TB hard drive and some mirrored LTO5 tapes. This backup includes everything on BAXIAL’s (my main linux server) /media/BAXIAL’s ZFS pooled drives (with the exceptions of /Movies and /TV Shows) because of space constraints. I do have multiple copies of these folders elsewhere.

I’ll be updating this backup every 90 days. I will be sneakernetting it over to a friends house.

Making the Backups

I’m using CMD Generator (a nice bash command generator) to create the rsync command I’ll be using for backups. Right now, this will happen manually. In the future, it should happen automatically.

Here is the command for the initial copy (with a dry run):

rsync -vrlpt --exclude "TV Shows/" --exclude Movies/ --progress --dry-run /media/BAXIAL /media/brendan/BPSOFFSITE1

Here’s the command for the initial copy (without a dry run):

rsync -vrlpt --exclude "TV Shows/" --exclude Movies/ --progress /media/BAXIAL /media/brendan/BPSOFFSITE1

To update the files listed, and to delete files that no longer exist on the source /media/BAXIAL pool, I’ll use this command:

rsync -vrlptui --delete --exclude "TV Shows/" --exclude Movies/ --progress /media/BAXIAL /media/brendan/BPSOFFSITE1

Remember, rsync prefers relative paths when you are already in the directory you want to backup. If you are at a bash prompt in your home directory, use the absolute path in the command.

A .txt list of files

I also wanted a list of media files in the /media/BAXIAL/Movies and /media/BAXIAL/TV Shows folders should I ever want a record. In a SHTF scenario, for example, it would be nice to have some ability to know exactly what media I had in those folders.

Loading more...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help