Scroll to navigation

BORG-MATCH-ARCHIVES(1) borg backup tool BORG-MATCH-ARCHIVES(1)

NAME

borg-match-archives - Details regarding match-archives

DESCRIPTION

The --match-archives option matches a given pattern against the list of all archives in the repository. It can be given multiple times.

The patterns can have a prefix of:

  • name: pattern match on the archive name (default)
  • aid: prefix match on the archive id (only one result allowed)
  • user: exact match on the username who created the archive
  • host: exact match on the hostname where the archive was created
  • tags: match on the archive tags

In case of a name pattern match, it uses pattern styles similar to the ones described by borg help patterns:

Simple string match, must fully match exactly as given.
Match like on the shell, wildcards like * and ? work.
https://docs.python.org/3/library/re.html>
, selector re: Full regular expression support. This is very powerful, but can also get rather complicated.

Examples:

# name match, id: style
borg delete --match-archives 'id:archive-with-crap'
borg delete -a 'id:archive-with-crap'  # same, using short option
borg delete -a 'archive-with-crap'  # same, because 'id:' is the default
# name match, sh: style
borg delete -a 'sh:home-kenny-*'
# name match, re: style
borg delete -a 're:pc[123]-home-(user1|user2)-2022-09-.*'
# archive id prefix match:
borg delete -a 'aid:d34db33f'
# host or user match
borg delete -a 'user:kenny'
borg delete -a 'host:kenny-pc'
# tags match
borg delete -a 'tags:TAG1' -a 'tags:TAG2'


AUTHOR

The Borg Collective

2024-10-12