Skip to content

borg2: Allow comma-separated archive IDs in aid: matcher #10313

Description

@PhrozenByte

The aid: archive match pattern currently matches exactly one archive ID. Multiple -a / --match-archives options are combined using AND semantics, so there is currently no convenient way to explicitly select multiple archives by their unique IDs.

For example, the following does not match either archive, since an archive cannot have both IDs:

$ borg2 repo-list -r /run/media/daniel/prometheus/Borg/ -a aid:8961fcf1 -a aid:466b7c4d
Command error: archive ID based match needs to match precisely one archive ID

Suggestion

Allow aid: to accept a comma-separated list of archive IDs, with OR semantics within the pattern. All archive IDs given must still match exactly one archive.

For example:

$ borg2 repo-list -r /run/media/daniel/prometheus/Borg/ -a aid:8961fcf1,466b7c4d
8961fcf1  Mon, 2026-08-24 11:24:32 +0200  Tuxedo-InfinityBook-14              daniel      Tuxedo-InfinityBook-14  Arch Linux (Last Update: 2026-08-20T00:1
466b7c4d  Tue, 2026-08-25 12:21:14 +0200  Tuxedo-InfinityBook-14              daniel      Tuxedo-InfinityBook-14  Arch Linux (Last Update: 2026-08-24T15:4

This could retain the current behavior for a single ID while providing a simple way to explicitly select multiple known archives.

Benefits

This would

  • allow explicitly selecting multiple unique archives,
  • avoid requiring multiple matcher options with different semantics,
  • make aid: more useful for scripts and other programmatic archive selection,
  • allow processing multiple explicitly selected archives in a single borg2 invocation instead of running borg2 separately for each archive, which can reduce overall runtime.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions