Uploading snapshots with schnapps by ssh, help needed

Hi all,

first of all, thank you very much for the great schnapps tool. As BTRFS volumes are new to me this tool really makes handling those more simple. (Which should not stop me from trying to understand how btrfs works under the hood).

I’m trying to backup my Turris MOX and the attached SSD (mounted in /srv) to an external server by using ssh. I’ve read in schnapps help and the schnapps documentation that an upload option exists which exports the snapshot to a remote site.

Nevertheless I somehow fail to use the upload option. Here is my setup:
On the remote-server a user called backup exists, and the ssh-public-key of root on the turris mox is added to its authorized-keys file. A login with ssh backup@remoteserver works as expected. The userhome of backup is somewhere deep in /mnt/raid/backup and writeable for the backup-user. I also added an entry for the remoteserver in ~/.ssh/config which defines the user that has to be used.

When I try to do upload a snapshot, schnapps complains about an incorrect syntax:

root@turris:~# schnapps upload 86 ssh://remoteserver/ /mnt/raid/backup/
read: Connection reset by peer
Export takes target directory as argument!

My Turris-OS version is 5.0.4

Do you have any hints what is the problem here?

Try
schnapps export 86 /mnt/raid/backup/

Hi @sedlak.mila

thank you for your reply. Export will simply generate a snapshot as tar file in the specified local directory. I tried that and it works flawlessly as it seems.

The problem I’m experiencing here, is that upload does not seem to work as documented.

Thank you for your information about this problem. It is a bug and will be solved: https://gitlab.nic.cz/turris/schnapps/-/issues/22

3 Likes

Thank you for opening this issue.

1 Like

@ljelinek was this already merged into 5.1.10?
I still get the “Export takes target directory as argument!” message

root@turris:~# cat /etc/turris-version 
5.1.10
root@turris:~# schnapps upload 45 ssh://backup@remoteserver /mnt/raid/backup/
Export takes target directory as argument!

Stupid me. I mistyped the number of the snapshot. Sorry for the mess.

BTW: If sshfs is unable to mount the remote directory, for instance because of insufficient file permissions, schnapps will create the folder /mnt/.remote-snapshotson the local storage, for instance mmcblk1p1, and will even report a successful backup. In my opinion, schnapps should die when sshfs fails.

For the record, this is what worked for me:

  1. Store username and Host-IP for the remote host in .ssh/config of the turris router
  2. Make sure the user has write permissions to the backup-directory
  3. schnapps upload NUMBEROFSNAPSHOT ssh://remotehostnamefromsshconfig:/absolute/path/to/directory/

Thank you for reporting the problems with sshfs. I’ve created an issue for it: https://gitlab.nic.cz/turris/schnapps/-/issues/36

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.