How to backup to samba repository?

#1

I have created the initial backup to repository on external disk. Then I copied the repository to smb NAS. I am struggling with access to NAS repository. How should I properly format the command “restic snapshots -r smb://192.168.0.2/BACKUPS/Restic/”? This syntax does not work. Thank you

0 Likes

#2

Just mount your NAS share, for example:

sudo mount //192.168.0.2/BACKUPS /mnt
restic -r /mnt/Restic backup /...
1 Like

#3

Personally, I don’t trust Samba for other than sharing files/documents. I have always use Samba for sharing and works great, but for restic you should be better using the sftp backend. If you can setup ssh (and use passwordless key for automation) in your NAS and don’t want to mount the smb share every time you want to use restic, sftp could be better for you and the syntax would be as you pointed: restic -r sftp:user@192.168.0.2:/BACKUPS/Restic. That way you don’t have to mount anything. Otherwise, you should do what @sniner suggest.

1 Like

#4

Solved. Neither the recommended smb/cifs or sftp worked. But I was able to install nfs by:
sudo apt-get install nfs-common

, configured NFS on server and then I mounted:
sudo mount -t nfs 192.168.0.2:/nfs/BACKUPS /mnt
(I use My Book World and it directs that nfs share should be accessed as …/nfs/share )
Then the repository appeared at /mnt/Restic and I could run backup.

0 Likes