https:\/\/blog.ls-al.com\/restic-create-backup-and-set-tag-with-date-logic<\/a> here is some code I used to set tags on old snapshots to comply with my new tagging and pruning.<\/p>\n# cat backup-tags-set.sh\n#!\/bin\/bash\n\ncreate_tag () {\n tag=daily\n if [ $(date -d $1 +%a) == Sun ]; then tag=weekly ; fi\n if [ $(date -d $1 +%d) == 01 ]; then \n tag=monthly\n if [ $(date -d $1 +%b) == Jan ]; then\n tag=yearly\n fi\n fi\n}\ncreate_tag\necho backup policy: $tag\n\n#source \/root\/.restic.env\nsnapshotids=$(restic snapshots -c | egrep -v ID|snapshots|-- | awk '\/\/{print $1;}')\nfor snapshotid in $snapshotids\ndo\n snapdate=$(restic snapshots $snapshotid -c | egrep -v ID|snapshots|-- | awk '\/\/{print $2;}')\n create_tag $snapdate\n echo Making a tag for: $snapshotid - $snapdate - $(date -d $snapdate +%a) - $tag\n restic tag --set $tag $snapshotid\ndone<\/code><\/pre>\nRun<\/h3>\n# .\/backup-tags-set.sh \nbackup policy: daily\nMaking a tag for: 0b88eefa - 2019-03-27 - Wed - daily\nrepository 00cde088 opened successfully, password is correct\ncreate exclusive lock for repository\nmodified tags on 1 snapshots\nMaking a tag for: d76811ac - 2019-03-27 - Wed - daily\nrepository 00cde088 opened successfully, password is correct\ncreate exclusive lock for repository\nmodified tags on 1 snapshots<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"In a follow up to previous post https:\/\/blog.ls-al.com\/restic-create-backup-and-set-tag-with-date-logic here is some code I used to set tags on old snapshots<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,99],"tags":[],"class_list":["post-1427","post","type-post","status-publish","format-standard","hentry","category-backups","category-restic"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1427","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=1427"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1427\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=1427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=1427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=1427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}