~

Backup my way

First thing first, I want to list my own devices, which I have through the years:

App/Service I use daily:

The purpose is that I want my data to be safe, secure, and can be easily recovered if I lost some devices; or in the worst situation, I lost all. Because you know, it is hard to guess what is waiting for us in the future.

There are 2 main sections which I want to share, the first is How to backup, the second is Recovery strategy.

How to backup

Before I talk about backup, I want to talk about data. In specifically, which data should I backup?

I use Arch Linux and macOS, primarily work in the terminal so I have too many dotfiles, for example, ~/.config/nvim/init.lua. Each time I reinstall Arch Linux (I like it a lot), I need to reconfigure all the settings, and it is time-consuming.

So for the DE and UI settings, I keep it as default as possible, unless it's getting in my way, I leave the default setting there and forget about it. The others are dotfiles, which I write my own dotfiles tool to backup and reconfigure easily and quickly. Also, I know that installing Arch Linux is not easy, despite I install it too many times (like thousand times since I was in high school). Not because it is hard, but as life goes on, the official install guide keeps getting new update and covering too many cases for my own personal use, so I write my own guide to quickly capture what I need to do.

So that is my dotfiles, for my regular data, like Wallpaper or Books, Images, I use Google Drive (actually I pay for it). But the step: open the webpage, click the upload button and choose files seems boring and time-consuming. So I use Rclone, it supports Google Drive, One Drive and many providers but I only use Google Drive for now. The commands are simple:

# Sync from local to remote
# remote can be gdrive, 1drive, ..., anything you previously config with rclone
rclone sync MyBooks remote:MyBooks -P --exclude .DS_Store

# Sync from remote to local
rclone sync remote:MyBooks MyBooks -P --exclude .DS_Store

Before you use Rclone to sync to Google Drive, you should read Google Drive rclone configuration first.

For private data, I use restic which use Rclone as backend:

# Init
restic -r rclone:remote:PrivateData init

# Backup
restic -r rclone:remote:PrivateData backup PrivateData

# Cleanup old backups
restic -r rclone:remote:PrivateData forget --keep-last 1 --prune

# Restore
# Be careful because restic restore fullpath
# See https://github.com/restic/restic/issues/2092
restic -r rclone:remote:PrivateData restore latest --target ~

The next data is my passwords and my OTPs. These are the things which I'm scare to lose the most. First thing first, I enable 2-Step Verification for all of my important accounts, should use both OTP and phone method.

I use Bitwarden for passwords (that is a long story, coming from Google Password manager to Firefox Lockwise and then settle down with Bitwarden) and Aegis for OTPs. The reason I choose Aegis, not Authy (I use Authy for so long but Aegis is definitely better) is because Aegis allows me to extract all the OTPs to a single file (can be encrypted), which I use to transfer or backup easily.

As long as Bitwarden provides free passwords stored, I use all of its apps, extensions so that I can easily sync passwords between laptops and phones. The thing I need to remember is the master password of Bitwarden in my head.

With Bitwardent/Aegis, I also can export the data (must always be encrypted), then:

Backup work related data

APIs tools:

Stay away from Postman, it's lag and you can accidentally upload private data publicly.

Recovery strategy

There are many strategies that I process to react as if something strange is happening to my devices.

Misc

To backup everything is hard, so keep it simple and only backup important things. Pick one then stay away from other cloud services:

The end

This guide will be updated regularly I promise.

Feel free to ask me via email or Mastodon. Source code is available on GitHub