Skip to content

Feature request: snbk ssh-pull modeΒ #1185

Open

Description

@bilgincoskun

Currently snapper only supports ssh-push mode for sending backups to a remote server. It would be good to have ssh-pull mode as well, to get backups from a remote server.

Activity

  1. jameslai-dev commented on Sep 11, 2026

    @jameslai-dev
    Contributor

    I would like to clarify your requirement. Assume you configure snbk in SSH-push mode, and you want to transfer a backed-up snapshot from the target server back to your source device. This is already supported using snbk restore. The feature is available from v0.13.1.

    Image

    You can view the man page for more details.
    Does this feature meet your requirements?

  2. bilgincoskun commented on Sep 11, 2026

    @bilgincoskun
    Author

    Not exactly. If I'm not mistaken, snbk restore command pulls local backups that have been sent to remote, right?What I need is to initiate a backup of a subvolume on remote and pull that backup into local.

    My current workaround is to configure local-only backups on remote machine and to use btrfs send and receive. However, it is inefficient due to not tracking parent subvolume information.

    From what I have seen, btrbk supports this feature: https://github.com/digint/btrbk#example-fileserver-initiated-backups-from-several-hosts

    Also, baksnapper seems to support this feature for snapper backups as well: https://github.com/plattfot/baksnapper#backup-from-a-remote-machine-over-ssh

  3. jameslai-dev commented on Sep 11, 2026

    @jameslai-dev
    Contributor

    Sorry for the misunderstanding. I don't use either btrbk or baksnapper, and I'm quite confused about your requirement.
    I guess your definitions of local and remote may be different from mine.

    To better understand your use case, I want to make sure we're using the same definitions when discussing this.
    Here are my definitions:

    • Source Filesystem: the Btrfs filesystem that contains the subvolumes and the data you want to back up.
    • Local: the machine that contains the source filesystem.
    • Target Filesystem: the Btrfs filesystem where the backed-up snapshots reside.
    • Target Server: the machine that contains the target filesystem.

    snapperd and snbk run on Local, so:

    • snapperd makes snapshots on Source Filesystem.
    • snbk transfer sends the snapshots from Source Filesystem to Target Filesystem. (Sender: Source Filesystem; receiver: Target Filesystem)
    • snbk restore sends the snapshots from Target Filesystem to Source Filesystem. (Sender: Target Filesystem; receiver: Source Filesystem)

    What I need is to initiate a backup of a subvolume on remote and pull that backup into local.

    Let me try to map your use case onto my definitions. Do you want snbk to run on Target Server and back up the snapshots on Source Filesystem?

  4. bilgincoskun commented on Sep 11, 2026

    @bilgincoskun
    Author

    Yes, that is pretty much it.

  5. aschnell commented on Sep 16, 2026

    @aschnell
    Member

    What is the motivation? That your backup server is not reachable but the source machine is?

  6. bilgincoskun commented on Sep 17, 2026

    @bilgincoskun
    Author

    Yes, here is a scenario where I think this feature could come in handy: my home computer is behind CGNAT and uses a dynamic IP. On the other hand, my office computer has a public static IP, so connecting from home to the office is much easier than doing the reverse. Of course, there are various workarounds for such setups, but having an ssh-pull method available would make things more convenient.

  7. aschnell commented on Oct 15, 2026

    @aschnell
    Member

    On implementation challenge: The snapper config on the source must be locked from the code running on the target. AFAIS that is currently not possible.

  8. aschnell commented on Oct 21, 2026

    @aschnell
    Member

    I have implemented the ssh-pull target-mode in #1206. Missing is the locking of the snapper config on the source.

    Feedback is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions