Restic find and list one file
Sometimes I just want to quickly look if one file exist in the latest snapshot and also see the size. Here is how.
Determine latest snapshot
# restic snapshots | tail -10
09fdf7e5 2021-01-16 23:30:02 usph-vmli-do01 daily
/tank01/backups/sites3
Find
# restic find -s 09fdf7e5 wpsites_dump.sql
repository 1144d629 opened successfully, password is correct
Found matching entries in snapshot 09fdf7e5 from 2021-01-16 23:30:02
/tank01/backups/sites3/databases/wpsites_dump.sql
List
# restic ls -l 09fdf7e5 /tank01/backups/sites3/databases/wpsites_dump.sql
repository 1144d629 opened successfully, password is correct
snapshot 09fdf7e5 of [/tank01/src /tank01/stack /tank01/backups/sites3] filtered by [/tank01/backups/sites3/databases/wpsites_dump.sql] at 2021-01-16 23:30:02.785360824 -0600 CST):
-rw-r--r-- 0 0 1326541 2021-01-16 20:00:13 /tank01/backups/sites3/databases/wpsites_dump.sql
List Directory
root@desktop01:~# restic ls -l 09fdf7e5 /tank01/backups/sites3/databases
repository 1144d629 opened successfully, password is correct
snapshot 09fdf7e5 of [tank01/stack /tank01/backups/sites3] filtered by [/tank01/backups/sites3/databases] at 2021-01-16 23:30:02.785360824 -0600 CST):
drwxr-xr-x 0 0 0 2020-05-25 09:02:19 /tank01/backups/sites3/databases
...
-rw-r--r-- 0 0 1326541 2021-01-16 20:00:13 /tank01/backups/sites3/databases/wpsites_dump.sql