Storing absolute paths or relative paths?

Hi,

As shown in the examples below, restic seem to store the absolute path (c:\R1, when doing ‘ls’). But if you
cd to the folder (c:\R3), then it only stores for the snapshot (doing ‘snapshots’)

What is the meaning of having the full path on the snapshots?

Do I have to go do cd to the folder if I don’t want absolute path? (i.e. there is not an option like ‘–root-path c:\TOBK’)

c:>restic -r c:\R1 backup c:\TOBK
enter password for repository:
repository 81ae5660 opened (version 2, compression level auto)
created new cache in C:\Users\jalcaide\AppData\Local\restic
found 3 old cache directories in C:\Users\jalcaide\AppData\Local\restic, run restic cache --cleanup to remove them
no parent snapshot found, will read all files
[0:00] 0 index files loaded

Files: 5 new, 0 changed, 0 unmodified
Dirs: 4 new, 0 changed, 0 unmodified
Added to the repository: 91.322 MiB (89.589 MiB stored)

processed 5 files, 91.313 MiB in 0:03
snapshot b079617d saved

c:>

c:\TOBK>restic -r c:\R1 ls latest
enter password for repository:
repository 81ae5660 opened (version 2, compression level auto)
found 3 old cache directories in C:\Users\jalcaide\AppData\Local\restic, run restic cache --cleanup to remove them
[0:00] 100.00% 1 / 1 index files loaded
snapshot b079617d of [c:\TOBK] at 2025-12-13 01:06:01.7848264 +0100 CET by CISCO\jalcaide@CSCO-W-PW0JCGJ7 filtered by :
/c
/c/TOBK
/c/TOBK/20240908_011833.mp4
/c/TOBK/PICS
/c/TOBK/PICS/20240908_021559.jpg
/c/TOBK/SUBFOLDER
/c/TOBK/SUBFOLDER/x1.txt
/c/TOBK/x1.txt
/c/TOBK/x2.txt

c:\TOBK>restic -r c:\R1 snapshots
enter password for repository:
repository 81ae5660 opened (version 2, compression level auto)
found 3 old cache directories in C:\Users\jalcaide\AppData\Local\restic, run restic cache --cleanup to remove them
ID Time Host Tags Paths Size

b079617d 2025-12-13 01:06:01 CSCO-W-PW0JCGJ7 c:\TOBK 91.313 MiB

1 snapshots

c:\TOBK>

c:\TOBK>restic -r c:\R3 backup .
enter password for repository:
repository 6bc754b7 opened (version 2, compression level auto)
created new cache in C:\Users\jalcaide\AppData\Local\restic
found 3 old cache directories in C:\Users\jalcaide\AppData\Local\restic, run restic cache --cleanup to remove them
no parent snapshot found, will read all files
[0:00] 0 index files loaded

Files: 5 new, 0 changed, 0 unmodified
Dirs: 2 new, 0 changed, 0 unmodified
Added to the repository: 91.322 MiB (89.589 MiB stored)

processed 5 files, 91.313 MiB in 0:02
snapshot 918af900 saved

c:\TOBK>

c:\TOBK>restic -r c:\R3 ls latest
enter password for repository:
repository 6bc754b7 opened (version 2, compression level auto)
found 3 old cache directories in C:\Users\jalcaide\AppData\Local\restic, run restic cache --cleanup to remove them
[0:00] 100.00% 1 / 1 index files loaded
snapshot 918af900 of [c:\TOBK] at 2025-12-13 01:20:24.4270613 +0100 CET by CISCO\jalcaide@CSCO-W-PW0JCGJ7 filtered by :
/20240908_011833.mp4
/PICS
/PICS/20240908_021559.jpg
/SUBFOLDER
/SUBFOLDER/x1.txt
/x1.txt
/x2.txt

c:\TOBK>restic -r c:\R3 snapshots
enter password for repository:
repository 6bc754b7 opened (version 2, compression level auto)
found 3 old cache directories in C:\Users\jalcaide\AppData\Local\restic, run restic cache --cleanup to remove them
ID Time Host Tags Paths Size

918af900 2025-12-13 01:20:24 CSCO-W-PW0JCGJ7 c:\TOBK 91.313 MiB

1 snapshots

c:\TOBK>

Hi @resticint001

It seems restic always stores an absolute path in the path field of the snapshot file while it correctly stores relative paths in the snapshot tree.

I agree this is inconsistent; I assume it can’t be changed due to backward-compatibility-issues.

I went down this rabbit hole recently, and I think what you might be looking for is the –strip-prefix option that’s on the roadmap for Restic 0.19. More details are available in the Github discussion thread.

2 Likes