Hostwinds是一家知名的美国主机商,国内站长使用较多的是美国VPS主机,其VPS产品方案多样,支持全球cdn/' target='_blank'>CDN加速,国内外用户访问速度都比较快。Hostwinds云备份默认有60个快照,restic备份存储随着时间推移形成重复快照,需要删除。下面就来看下删除restic备份快照的操作步骤。
1、我们要想删除以前的快照,将会用到forget和prune两个命令。首先我们登录到Hostwinds VPS主机,然后初始化repo以能够在restic中执行操作,相关运行命令及输出结果如下。
# restic snapshots
password is correct
ID Date Host Tags Directory
———————————————————————-
37f632eb 2021-06-04 11:32:43 hwkb.hostwindsdns.com all_databases.sql
b923eed6 2021-06-04 11:45:17 hwkb.hostwindsdns.com database_dump.sql
———————————————————————-
2 snapshots
2、使用上面命令,在输出中我们可以看到有2个备份。要删除快照,还需要知道快照的ID。在此示例中,我们将删除具有ID的第二个快照b923eed6,运行命令如下。
# restic forget b923eed6
password is correct
storage ID 9babef79
removed snapshot b923eed6
3、接下来,您需要运行reyic prune命令。运行此命令后将会删除从restic存储库中快照引用的数据,清理未引用的数据。
# restic prune
password is correct
storage ID 9babef79
counting files in repo
building new index for repo
[2:16] 100.00% 11981 / 11981 packs
repository contains 11981 packs (345057 blobs) with 56.676 GiB
processed 345057 blobs: 0 duplicate blobs, 0B duplicate
load all snapshots
find data that is still in use for 1 snapshots
[0:00] 100.00% 1 / 1 snapshots
found 2 of 345057 data blobs still in use, removing 345055 blobs
will remove 0 invalid files
will delete 11979 packs and rewrite 0 packs, this frees 56.664 GiB
counting files in repo
[0:00] 100.00% 2 / 2 packs
finding old index files
saved new indexes as [70561784]
remove 11 old index files
[1:12] 100.00% 11979 / 11979 packs deleted
done
建议在修剪后运行restic 检查,以确保您存储库的内部数据结构没有损坏。
# restic check
现在,当您查看备份快照时,将不再列出所删除的条目。
# restic snapshots
更多教程:Hostwinds教程
来源链接:https://www.idcspy.com/32132.html
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。
Copyright © 2009-2022 56dr.com. All Rights Reserved. 特网科技 特网云 版权所有 特网科技 粤ICP备16109289号
域名注册服务机构:阿里云计算有限公司(万网) 域名服务机构:烟台帝思普网络科技有限公司(DNSPod) CDN服务:阿里云计算有限公司 百度云 中国互联网举报中心 增值电信业务经营许可证B2
建议您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流浏览器浏览本网站