Backup KDE neon with Kup

Kup Backup

Kup is a backup scheduler for KDE neon that uses rsync or bup depending on whether you want to do incremental backups or a synchronised backup. Primarily it is used to backup to USB (It will recognise when the USB drive is attached) but it can also be used to backup to an smb share with a few tricks.

To install Kup backup on KDE neon open Konsole and type,

sudo apt install kup-backup

Then press enter, authenticate with your password, and answer any questions asked of you. After installation Kup can be found in the Application Menu under Applications/Settings in System Settings under Backups or by selecting the menu and typing its name.

Tips and tricks

Kup backup worked just fine for as a backup to a USB disk from my desktop but on my Laptop I wanted to get it to backup to a network share. This was a little harder, although only cause it took me a little while to figure out what I was doing. If I had of been connected by Ethernet then I could have mounted the network share in fstab but over wireless I ended up using autofs (It looks like you can now mount a share using systemctl as well).

Autofs automatically mounts filesystems when they are available. It requires a touch of set-up but should take care of itself after that. The steps I took here are modifications of Nicolas Bernaerts. Worth a read.

For starters I needed to install cifs-utils and autofs.

sudo apt-get install cifs-utils autofs

Then I made a directory for the mount under /mnt and changed the permissions with,

sudo mkdir /mnt/NAS
sudo chmod 0666 /mnt/NAS

I then needed to edit /etc/auto.master which I did using Nano. Basically, you open the file using nano,

sudo nano /etc/auto.master

Scrolled to the end of file using the down arrow key and just above the line #+auto.master pushed enter to create a new line with no # and entered,

/home/<insert username>/NAS /etc/auto.server    --timeout=6000    --ghost

It also should be noted that as in Nicolas Bernaerts version there was no # in front of +auto.master at the end of the file. This needed to be changed so it did have a # to comment out the line.

The reason I used my username in the path above is to mount the share inside my home directory for easy access.

In nano use ctl+x keys save the file, then y for yes and hit enter to save to the same filename.

The next file I needed to edit was /etc/auto.server so I did the same things again in reference to nano.

sudo nano /etc/auto.server

In this file I added a line suspiciously like,

NAS -fstype=cifs,uid=1000,credentials=/etc/auto.auth ://192.168.0.250/home/

Basically this means the autofs mount NAS of filesystem cifs should be mounted with user id 1000 referencing credentials kept at /etc/auto.auth and the share to be mounted is at //192.168.0.250/home/. These things will probably be different for you. For instance you can find your userid by typing,

id -u <username>

The reason I use uid is to make the share writeable by me. Otherwise the share gets mounted but read only.

The final file to create is the /etc/auto.auth file referenced above as where to find the credentials of the file share. Or, to put it another way, the username and password you have to enter to use the share. Yet again with nano I opened a file with,

sudo nano /etc/auto.auth

In this file I added the shares username and password in this format,

username=nobody
password=xxxxxx

And save it. After that all there was to be done was to restart autofs with,

sudo systemctl restart autofs.service

It should all work now and the share should accessible in your home folder. There is one last thing to do in Kup though and that is to go and make sure of you have selected all your home folder to backup that you havn’t got the mounted share selected as well. This would cause the backup to try and backup to itself. A never ending loop probably.

Leave a Reply

Your email address will not be published. Required fields are marked *