How to restore all partial snapshots at once?

Hi,

I want to start to use Restic with B2 instead of my backup scripts, but here comes a problem as below:

I ran a service on a server(called ‘ServerA’), with very limited HDD space, so I could only keep the last N hours log files on ServerA, and I used to remove logs after doing a backup.

I think ServerA may work as below:

(write to logs/a.log) => until it meet the size limitation I set
(write to logs/b.log) => until it meet the size limitation I set
(write to logs/c.log) => until it meet the size limitation I set

  restic backup logs => the Snapshot1 is [logs/a.log, logs/b.log, logs/c.log]
  (after backing up, remove logs/a.log and logs/b.log)

(write to logs/c.log) => until it meet the size limitation I set
(write to logs/d.log) => until it meet the size limitation I set
(write to logs/e.log) => until it meet the size limitation I set

  restic backup logs => the Snapshot2 is [logs/c.log, logs/d.log, logs/e.log]
  (after backing up, remove logs/c.log and logs/d.log)

...
...

Then I want to see all logs from another server(called ‘ServerB’), if I just restore the latest snapshot of logs, I could only restore the latest k log file (ex. logs/x.log logs/y.log logs/z.log)

Is there any way to restore all files (from a.log to z.log) ?

Or is there any suggestions for this scenario ?

You could restic mount the snapshots and browse through them. If needed you can use find to search for specific files and restore them.

Thanks, currently I can use this way to get all of them, but a little hard to automate.

Ideally, I want to merge all snapshots of the same folder or keep the entire file list in the last snapshot. But after some attempts, I think if I use some scripts to manage those files before backup, I may not need to merge snapshots while recovery :slight_smile: