Skip to content

Please add backup "name" or "id" to config #1520

Closed

Description

@dionorgua

Right now backups are identified by "sources":

[[backup.snapshots]]
sources = [ "/home" ]
tags = [ "home" ]

So I can run rustic backup /home and it'll automatically apply all settings like "home" tag, hooks, etc.

The problem is when I want to say rustic backup /home but In fact I need to backup different folder due to btrfs snapshots:

So the idea is to decouple "snapshot" selection from actual source path to backup and get something like:

[[backup.snapshots]]
name = "/home"
sources = [ "/mnt/snapshot/home" ]
tags = [ "home" ]
as-path = "/home"
hooks.run_before = [ "btrfs subvolume snapshot -r /home /mnt/snapshot/home" ]
hooks.run_finally = [ "btrfs subvolume delete -c /mnt/snapshot/home" ]

Basically I still can do it like this and just run as rustic backup /mnt/snapshot/home. But it less convenient.

Maybe we can name it as id = @home and use rustic backup @home syntax

Activity

  1. added
    S-triageStatus: Waiting for a maintainer to triage this issue/PR
    on Aug 6, 2025
  2. rdelaage commented on Aug 17, 2025

    @rdelaage
    Contributor

    As far as I understand, you can use a label for that

  3. dionorgua commented on Aug 17, 2025

    @dionorgua
    Author

    @rdelaage I don't see how label can be used here. As far as I see it's just generic "comment" that can be added to backup.

    So yes. Technically it can be reused as sort of backup 'id' field, (while it'll be sad to loose comment field).

    But I don't see a way to explicitly tell rustic to run only backups with certain label.

  4. rdelaage commented on Aug 17, 2025

    @rdelaage
    Contributor

    I understand the label field as a name for the snapshot, so you could say that the snapshots of your home folder are named "/home" using rustic backup --label home /mnt/snapshot/home and use this label when you want to apply a retention policy or to restore the data rustic restore --filter-label home latest myrestorefolder

    You also have a description field for comments

  5. dionorgua commented on Aug 17, 2025

    @dionorgua
    Author

    The issue here is not retention policy or other filtering stuff after backup at all. I'm completely fine to write that for /mnt/snapshot/home if needed.

    The issue is that I want to be able to reference backups by id or real source path before/during backup. Without using temporary mount points

  6. aawsome commented on Aug 20, 2025

    @aawsome
    Member

    @dionorgua In #1531 I added the possibility to use id = "id_name" in the config and then use rustic backup --id id_name to only backup this snapshot config. Feel free to try it out!

  7. aawsome commented on Sep 1, 2025

    @aawsome
    Member

    @dionorgua is now implemented using name and --name, see #1531

  8. added a commit that references this issue on Sep 1, 2025
    9f4a6ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-triageStatus: Waiting for a maintainer to triage this issue/PR

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions