{"id":1710,"date":"2021-01-17T07:52:03","date_gmt":"2021-01-17T13:52:03","guid":{"rendered":"https:\/\/blog.iqonda.net\/?p=1710"},"modified":"2021-01-17T07:52:03","modified_gmt":"2021-01-17T13:52:03","slug":"restic-find-and-list-one-file","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/restic-find-and-list-one-file\/","title":{"rendered":"Restic find and list one file"},"content":{"rendered":"

Sometimes I just want to quickly look if one file exist in the latest snapshot and also see the size. Here is how.<\/p>\n

Determine latest snapshot<\/h2>\n
# restic snapshots | tail -10\n\n09fdf7e5  2021-01-16 23:30:02  usph-vmli-do01  daily         \n                                                             \/tank01\/backups\/sites3<\/code><\/pre>\n

Find<\/h2>\n
# restic find -s 09fdf7e5 wpsites_dump.sql\nrepository 1144d629 opened successfully, password is correct\nFound matching entries in snapshot 09fdf7e5 from 2021-01-16 23:30:02\n\/tank01\/backups\/sites3\/databases\/wpsites_dump.sql<\/code><\/pre>\n

List<\/h2>\n
# restic ls -l 09fdf7e5 \/tank01\/backups\/sites3\/databases\/wpsites_dump.sql\nrepository 1144d629 opened successfully, password is correct\nsnapshot 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):\n-rw-r--r--     0     0 1326541 2021-01-16 20:00:13 \/tank01\/backups\/sites3\/databases\/wpsites_dump.sql<\/code><\/pre>\n

List Directory<\/p>\n

root@desktop01:~# restic ls -l 09fdf7e5 \/tank01\/backups\/sites3\/databases\nrepository 1144d629 opened successfully, password is correct\nsnapshot 09fdf7e5 of [tank01\/stack \/tank01\/backups\/sites3] filtered by [\/tank01\/backups\/sites3\/databases] at 2021-01-16 23:30:02.785360824 -0600 CST):\ndrwxr-xr-x     0     0      0 2020-05-25 09:02:19 \/tank01\/backups\/sites3\/databases\n...\n-rw-r--r--     0     0 1326541 2021-01-16 20:00:13 \/tank01\/backups\/sites3\/databases\/wpsites_dump.sql<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

Sometimes I just want to quickly look if one file exist in the latest snapshot and also see the size.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[],"class_list":["post-1710","post","type-post","status-publish","format-standard","hentry","category-restic"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=1710"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1710\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=1710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=1710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=1710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}