Tarsnap on OpenBSD

⬅ Back to Notes

Updated 2021-03-18. (Tested on OpenBSD 6.8)

I’m comfortable with Tarsnap because I’ve used it on Windows before. Now that I’m looking to backup my configurations and files on my OpenBSD server, I thought I’d use Tarsnap again. Tarsnap doesn’t seem to be available when I ran pkg_info -Q tarsnap so the next best thing is to download and compile the source code from Tarsnap. I also installed OpenSSL since Tarsnap requires this package.

# Install OpenSSL
$ doas pkg_add openssl

# Extract and compile
$ tar xzf tarsnap-autoconf-1.0.39.tgz
$ cd tarsnap-autoconf-1.0.39/
$ ./configure
$ make

# Install Tarsnap
$ doas make install

I only want to use Tarsnap as a normal user instead of root, so I copied the configuration to ~/.tarsnaprc instead of /usr/local/etc/:

$ cp /usr/local/etc/tarsnap.conf.sample ~/.tarsnaprc

I then modified the configuration to point tarsnap.key and tarsnap-cache to my home directory:

# Tarsnap cache directory
cachedir /home/jag/tarsnap-cache

# Tarsnap key file
keyfile /home/jag/tarsnap.key

Then I ran tarsnap-keygen to generate the key that I’ll be using to access Tarsnap:

$ tarsnap-keygen --keyfile /home/jag/tarsnap.key --user *** --machine openbsd-amsterdam

After that, I ran my backup script. Everything is running smoothly!

Screenshot of Windows Terminal showing that I successfully backed up my files