Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

can borg list include folders without files? #9036

Open
@mlapaglia

Description

i am trying to create an archive browser that doesn't rely on borg mount. i'd like to get the files and folders at a specific path. i am having trouble creating a pattern that will return folders when they only have folders inside them.

Consider this archive:

borg list qwer::backup-20251003-022114
drwxrwxrwx mlapaglia mlapaglia 0 Fri, 2025年09月05日 21:53:18 mnt/c/backup-sources
drwxrwxrwx mlapaglia mlapaglia 0 Tue, 2025年09月02日 14:48:04 mnt/c/backup-sources/1990
-rwxrwxrwx mlapaglia mlapaglia 11000310 Tue, 2023年08月15日 15:01:14 mnt/backup-sources/1990/FastFoto_0489.tif

i am trying to get only the contents of the root of the repo, in this case /mnt would be the only thing returned.

these have no output:

borg list --json-lines \
 --pattern='+ pp:' \
 --pattern='- re:^[^/]+/.+' \
 qwer::backup-20251003-022114
borg list \
 --pattern '+ pf:mnt/' \
 --pattern '+ re:^mnt/[^/]+$' \
 --pattern '! re:^mnt/[^/]+/' \
 --pattern '- **' \
 qwer::backup-20251003-022114
 borg list --json-lines \
 --pattern='+ sh:mnt/*' \
 --pattern='- sh:mnt/*/*' \
qwer::backup-20251003-022114

when i try this on a folder that has files in it i get results:

 borg list \
 --pattern '+ pf:mnt/' \
 --pattern '+ re:^mnt/c/backup-sources/[^/]+$' \
 --pattern '! re:^mnt/c/backup-sources/[^/]+/' \
 --pattern '- **' \
 qwer::backup-20251003-022114
drwxrwxrwx mlapaglia mlapaglia 0 Tue, 2025年09月02日 14:48:04 mnt/c/backup-sources/1990
-rwxrwxrwx mlapaglia mlapaglia 19647677 Mon, 2025年08月25日 16:53:46 mnt/c/backup-sources/20250822-1713-13.5676762.mp4
-rwxrwxrwx mlapaglia mlapaglia 541624376 Thu, 2025年08月14日 06:01:00 mnt/c/backup-sources/LM-Studio-0.3.23-3-x64.exe
-rwxrwxrwx mlapaglia mlapaglia 205668352 Tue, 2025年09月02日 15:48:53 mnt/c/backup-sources/calibre-64bit-8.9.0.msi
-rwxrwxrwx mlapaglia mlapaglia 869341120 Fri, 2025年07月25日 18:37:21 mnt/c/backup-sources/577.00-desktop-win10-win11-64bit-international-dch-whql.exe
-rwxrwxrwx mlapaglia mlapaglia 592480176 Mon, 2025年07月28日 15:37:05 mnt/c/backup-sources/Docker Desktop Installer.exe
drwxrwxrwx mlapaglia mlapaglia 0 Mon, 2025年09月01日 19:54:36 mnt/c/backup-sources/testbackupsource

these output the entire archive

borg list \
 --pattern '+ *' \
 --pattern '- */*' \
 qwer::backup-20251003-022114
borg list --json-lines \
 --pattern='+ pp:mnt' \
 --pattern='- re:^mnt/[^/]+/.+' \
 qwer::backup-20251003-022114

is there a way to do this without traversing the whole archive to build up a virtual structure?

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

        AltStyle によって変換されたページ (->オリジナル) /