Easy GUI Linux Desktop backup to TrueNAS (with versioning)

kiriak

Contributor
Joined
Mar 2, 2020
Messages
122
I use the program Back In Time.
It has a GUI, it is superfast, uses rsync and saves folders and files using hardlinks.
So in the backup folder you have subfolfers with each backup you take in time, and all these folders contain hardliknks,
you can browse regularly like every other folder and from there you can restore or copy back entire folders or just files.
You can use it to make local backups also, like in a USB drive, where you can easily check it before using it to make backups to TrueNAS.

Caution: I am not a computer scientist or professional. I'm just a noob home user and want to share with other what works for me because this subject is frequently asked.
Check if it works correct before using it in production.
Any corrections to my process are welcome.


How I do it.

1. In TrueNAS

- select a user that will SSH to the NAS
- make a home for this user (in a dataset with UNIX permissions) in Users -> Edit -> Home Directory
- Enable SSH in Services and tick Start Automatically
- Choose a Dataset where the backups will be written. For me it worked for a dataset with UNIX permissions. Make owner of the dataset the user that will make the backups. Dataset can have other folders and you can choose/make one that the BackinTime will use.

2. In the PC

- Install Back In Time
- open terminal and type SSH user@ip, user is the TrueNAS user you selected before and the ip the IP of your NAS
- follow instructions (yes and give password of the TrueNAS user)
- run Back In Time -> settings -> Mode : SSH
- in SSH settings -> Host: the TrueNAS ip, User: the Truenas user, path: the path of the folder that backups will be written in the form /mnt/poolname/dataset/folder and leave everything else as is
- hit the green + button (it may be not available if it finds existing public/private SSH key)
- press YES and type TrueNAS user password when asked
- choose folders/files to be backed up
- choose retention rules
- hit OK

I hope I didn't forget anything crucial.
Look also here for detailed description
https://backintime.readthedocs.io/en/latest/index.html

Backups are written very very fast, are browsable like every other folder and smart retention rules can be set. You can have multiple profiles like another for Documents, another for Home minus(Documents, Pictures and Downloads) etc
I will say another time how fast the program works. I don't know how and why but it is far faster from any other backup program I used in NAS or HDD, in Linux or Windows. After the first backups I go to browse the files to believe that the backup finished right.

In a few months I used this in a test machine I made I didn't find any problems.
My concern is any issue with hard links and ZFS but I didn't but I'm not aware of any.
I even made snapshot replication of the backup dataset to another pool in a USB HDD and could read my data with versions from there just fine.
I'm not sure yet if versioning is necessary given the snapshot capabilities of ZFS. It may be useful for different retention requirements inside the same dataset or as an additional layer of security. I'm thinking as a noob, I like to achieve the same thing with different ways as I don't master these techniques well.
 
Last edited:

kiriak

Contributor
Joined
Mar 2, 2020
Messages
122
@kiriak Did you do this with password authentication or using a private/public key?

I used a private/public key-pair as described in the following documentation

https://backintime.readthedocs.io/en/latest/settings.html#general

The key-pair is automatically made by the Back In Time program.

You can have multiple profiles to different destinations with different rules for what to backup, how often, retention etc.,
I have 3 profiles:
a. to an permanently attached encrypted small USB stick for an extra copy of a few crucial files
b. to TrueNAS for almost all of my data on the PC
c. to an external HDD that I bring every other week in home

The filesystem of my Linux partition is not ZFS, so replication was not an option.
 

heis2201

Dabbler
Joined
Sep 10, 2020
Messages
25
If you use ubuntu desktop with a ZFS root, you can probably just replicate to TrueNAS SCALE and call it a day.
I am using Fedora, not Ubuntu, my root and home partition aren't on ZFS (and won't be in the future). I am looking for a backup solution involving any of the many GNU tools (nfs, rsync, ssh, ...), whatever works. So far, I am struggeling with everything I am touching.
 

heis2201

Dabbler
Joined
Sep 10, 2020
Messages
25
I used a private/public key-pair as described in the following documentation

https://backintime.readthedocs.io/en/latest/settings.html#general

The key-pair is automatically made by the Back In Time program.

You can have multiple profiles to different destinations with different rules for what to backup, how often, retention etc.,
I have 3 profiles:
a. to an permanently attached encrypted small USB stick for an extra copy of a few crucial files
b. to TrueNAS for almost all of my data on the PC
c. to an external HDD that I bring every other week in home

The filesystem of my Linux partition is not ZFS, so replication was not an option.
Thanks for your reply. That's what I am looking for but unfortunately, so far, I am not able to ssh into Truenas using a key pair. Password-auth works fine, but I am doing something wrong on the key-auth. Not sure what it is. I think the best would be to open a new topic just for that.

Once I get the key-based SSH connection established, I am sure I am able to configure Back-In-Time or Deja-Dup the way I want it....
 

kiriak

Contributor
Joined
Mar 2, 2020
Messages
122
Thanks for your reply. That's what I am looking for but unfortunately, so far, I am not able to ssh into Truenas using a key pair. Password-auth works fine, but I am doing something wrong on the key-auth. Not sure what it is. I think the best would be to open a new topic just for that.

Once I get the key-based SSH connection established, I am sure I am able to configure Back-In-Time or Deja-Dup the way I want it....
I am not an expert, but from what I remember it worked as it is described on the above documentation.
If you tried this already, you have to delete the old key from the Linux PC so that the Back In Time Program will create a new one.
I think it is in the hidden folder .SSH in the /home, but I am not sure so be cautious.
 

heis2201

Dabbler
Joined
Sep 10, 2020
Messages
25
OK, let me read the Back-in-time (B-i-t ) docs and get back to this forum. I already have a private/public key pair that I am using for other stuff, so I was hoping to reuse the same keys, but maybe that is not the best way to do it and I will let B-i-t create a new key pair.
 

Steasenburger

Explorer
Joined
Feb 12, 2020
Messages
52
Maybe a bit late to the party, but you can simply copy your existing public key to your truenas instance by using the `ssh-copy-id` command.
For example `ssh-copy-id your-truenas-username@your-truenas-ip`
 
Top