Ed Davies is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Flying to Iceland tomorrow, for a #Mailpile meetup!

Preparation: the pre-travel backup shuffle.

Last time I travelled, I bought a 128GB USB 3.0 stick.

Sooo huuuuge! And yet so tiny. This thing is big enough that I can make multiple rsync snapshots of my full home directory. Encrypted, of course.

If my laptop gets lost or stolen, I buy a new one, install Linux, take this thing out of my pocket, cp -a . /home/bre and get back to work.

If I shop decisively enough, that's less than a day's hit to my productivity.

@HerraBRE how often do you snapshot and with what tool/command?

@webmind Not as often as I should!

Media is USB storage, LUKS+EXT3/4.

Snapshots are made with rsync, in the mode where it compares the source with a previous snapshot, and the new snapshot ends up being mostly hard links to previously copied data.

Saves time and space, each snapshot is a complete browsable tree of files. This makes restoration of individual files is super easy, which I like.

The only downside is it breaks access times. If I cared I'd solve that with a read-only bind mound.

I commented my #rsync-based #backup script and put it in a gist.

gist.github.com/BjarniRunar/bd

I feel dirty. That should be on my own website. I hope it's useful!

๐Ÿ’พ ๐Ÿ“€ ๐Ÿ’ฟ ๐Ÿค–

@webmind

@HerraBRE @webmind Cool! I really like people sharing their snippets, it's always a pleasure to read someone elses work.
I can really recommend using `shellcheck` for any shell-scripting.

Some style aspects:
- `--exclude-file` is a great rsync feature, I can only recommend it
- Using `set -eu` improves writing style a lot
- trap is your friend
- Are you using any `bash` specific code? If not => `sh`
- false | true; echo $?

Ed Davies @edavies

@pl @HerraBRE @webmind Thanks, was already using set -e but adding -u (unset variables treated as an error) looks useful, too.

ยท Web ยท 0 ยท 0