This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kup backup tool and destination over smb

Tags: None
(comma "," separated)
User avatar
jacekrz
Registered Member
Posts
5
Karma
0
OS
I have NAS with smb shares. I'd like to setup Kup to make backups to destination on such smb share. I'm setting Kup (source, timetable and all the rest settings). In the destination I choose filesystem path and set it to: smb://user@nas_server.local/folder_with_backups. This path is reacheable via Dolphin, I can also reach it by clicking an icon "choose file" next to window with destination path . Next .... nothing happens. I get only icon/notification in systray, when I place mouse cursor over it - it displays info "New backup needed" and in second line "Backup destination place is unreaheable". And of course backup doesn't work. Is there any option to setup Kup to work over smb ?

Jacek Rzęsista
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
You probably need to add the share as a mount point in your fstab.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
User avatar
jacekrz
Registered Member
Posts
5
Karma
0
OS
claydoh wrote:You probably need to add the share as a mount point in your fstab.

In this way kup works. But I thought there is no need to mount smb share - KBackup works without mount
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
jacekrz wrote:
claydoh wrote:You probably need to add the share as a mount point in your fstab.

In this way kup works. But I thought there is no need to mount smb share - KBackup works without mount


Kup may not have this capability built in.

https://apps.kde.org/kup/

Support for local filesystem or external usb storage.
Monitor availability of backup destinations, like for example a mounted network storage.


https://bugs.kde.org/show_bug.cgi?id=445391
https://bugs.kde.org/show_bug.cgi?id=422534


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
User avatar
jacekrz
Registered Member
Posts
5
Karma
0
OS
claydoh wrote:
jacekrz wrote:
claydoh wrote:You probably need to add the share as a mount point in your fstab.

In this way kup works. But I thought there is no need to mount smb share - KBackup works without mount


Kup may not have this capability built in.

https://apps.kde.org/kup/

Support for local filesystem or external usb storage.
Monitor availability of backup destinations, like for example a mounted network storage.


https://bugs.kde.org/show_bug.cgi?id=445391
https://bugs.kde.org/show_bug.cgi?id=422534


Thanks for this bug tickets. I noticed from them, that kup doesn't work over smb, and should work over sftp/ssh. But there is no man/help/doc where I can find how to write down the path in this case. I send a message to developers, if I find a solution, I share it on the forum :)
User avatar
jacekrz
Registered Member
Posts
5
Karma
0
OS
Ok, so as I promised, after developer answer, I have done a solution, so here is small HOWTO for beginners and of course more advanced users :)

1. open your favourite terminal (konsole, yaquake whatever ;) )
2. change directory to .ssh subdirectory in your home directory:
cd ~/.ssh
3. generate ssh key so you can login on remote machine without password:
ssh-keygen
enter key name (e.g. remote_machine_key, no passphrase (click Enter - you will get key without password)
4. copy public part of generated key (as remote_user write down username on remote machine, as remote_host write down name or IP address of the remote machine):
ssh-copy-id remote_user@remote_host
5. install sshfs package:
sudo apt install sshfs
6. create mountpoint in your local filesystem (as your_login write down your local username, as mountpoint write down such a directory name as you want):
mkdir /media/your_login/mountpoint
6. create mount script catalog:
mkdir ~/.config/sshfsmount
7. create mount script - launch your favourite text editor (joe, mcedit, nano, vim, kwrite or kate ;) ) and copy this (as REMOTE_PATH write down path on the remote machine where you want the backup will write):
#!/bin/bash
MOUNTPOINT=/media/your_login/mountpoint
REMOTE_PATH=/path_on_the_remote_machine
REMOTE_USER=remote_user
REMOTE_HOST=remote_host

mount | grep "$MOUNTPOINT" &> /dev/null
if [ $? == 0 ]; then
exit 0
else
sshfs $REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH $MOUNTPOINT
fi

This script checks if your remote directory is already mounted and if not - mount it.
8. save this in the filename sshfsmount in .config/sshfsmount/ subdirectory in your home directory
9. change file attribute to executable:
chmod u+x .config/sshfsmount/sshfsmount
10. run KDE System Settings, find services/programs running with system start (autorun) and add a new one (add program,), in path window write down:
/home/your_login/.config/sshfsmount/sshfsmount
and click OK.
11. now log out your session and log in. Check (e.g. in Dolphin or in terminal with mount command) if the remote directory is mounted.
12. if everything went good, you have automounted on every system login remote directory (e.g. your NAS - as in mine case ;D ). Now it's time to run kup settings - run KDE System Settings, find Backups, check it active, add your plan and in destination place you can now write down path:
mkdir /media/your_login/mountpoint

And voille - you have working kup-backup over ssh to any remote host you want :-) Of course you have to remember about firewalls and opening ports for ssh (and running ssh server) on the remote host - but I think there is so many posts/HOWTO's on this subject so I won't duplicate them :)
User avatar
ianp5a
Registered Member
Posts
64
Karma
0
Yes, it seems way too complex for many people to successfully backup their stuff. I have not found any way for non IT experts can back up to a NAS on Kubuntu. Backing up, is quite important. But seems to have been forgotten for normal users.
User avatar
ianp5a
Registered Member
Posts
64
Karma
0
I upgraded to Kubuntu 22.04 and there is still no way to backup to a LAN share for non-IT people. The command line suggestion above is way too geeky and out of the question. I was under the impression that things would be improving.
Some suggest to mount the share, yet can't suggest any easy way to mount a share.
I've tried many Sync programs like Grsync. But they never include Network locations on the Destination browser.
Like Kup, lots of programs can't access the Network. Elisa lets you navigate Shares and select folders, but doesn't keep the reference. DigiKam has a network Collection setting that can't navigate to the network. Crazy.
I'm surprised how long this serious problem is taking to fix.
pemasat
Registered Member
Posts
1
Karma
0
Unfortunately Kubuntu 22.10 has same trouble. Still no possible make a user friendly backup to LAN destination. Any light on end of tunnel?
paulatz
Registered Member
Posts
2
Karma
0
You can use sshfs as said above, but it is not a good idea as it is slow, hogs your ssh connection and easily hangs if the connection is even briefly interrupted (i.e. you move your laptop around). If the backup server has samba shares, you can mount with CIFS which is much faster and sort of error tolerant.

Also, having to manually mount to filesystem (via ssh or cifs) is a pain and kills the advantage of having automatic backups. Personally, I would give up doing them after a couple of days.

My favorite way, is to add a line to /etc/fstab to automount the samba share. Now, when kup-backup probes for the share if the server is available, the directory will appear and the backup will start. The line to be added is something like this (only one line):
Code: Select all
//192.168.0.18/SHARENAME /cifs/SHARENAME cifs noauto,nofail,x-systemd.automount,x-systemd.idle-timeout=1min,uid=1000,gid=1000,username=SERVERUSER,password=SERVERPWD,workgroup=WGROUP  0 0


Explanation:
noauto,nofail : do not try to mount this directoy automatically, do not fail boot if it is not mounted
x-systemd.automount,x-systemd.idle-timeout=1min : automatically try to mount if requested, unmount after 1 minute if not used
uid=1000,gid=1000 : the local user and group id of the user that will own the directory (i.e. the output o command "id")
SERVERUSER ,SERVERPWD,WGROUP : the username, password and optionally workgroup to connect to the server
User avatar
jacekrz
Registered Member
Posts
5
Karma
0
OS
paulatz wrote:You can use sshfs as said above, but it is not a good idea as it is slow, hogs your ssh connection and easily hangs if the connection is even briefly interrupted (i.e. you move your laptop around). If the backup server has samba shares, you can mount with CIFS which is much faster and sort of error tolerant.

Also, having to manually mount to filesystem (via ssh or cifs) is a pain and kills the advantage of having automatic backups. Personally, I would give up doing them after a couple of days.

My favorite way, is to add a line to /etc/fstab to automount the samba share. Now, when kup-backup probes for the share if the server is available, the directory will appear and the backup will start. The line to be added is something like this (only one line):
Code: Select all
//192.168.0.18/SHARENAME /cifs/SHARENAME cifs noauto,nofail,x-systemd.automount,x-systemd.idle-timeout=1min,uid=1000,gid=1000,username=SERVERUSER,password=SERVERPWD,workgroup=WGROUP  0 0


Explanation:
noauto,nofail : do not try to mount this directoy automatically, do not fail boot if it is not mounted
x-systemd.automount,x-systemd.idle-timeout=1min : automatically try to mount if requested, unmount after 1 minute if not used
uid=1000,gid=1000 : the local user and group id of the user that will own the directory (i.e. the output o command "id")
SERVERUSER ,SERVERPWD,WGROUP : the username, password and optionally workgroup to connect to the server


I think it's easier than the way I described :-)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]