Hostwinds 튜토리얼

에 대한 검색 결과:


restic 백업 스냅 샷 제거

태그 : Snapshot,  Restic,  Backups 

RESTIC 백업은 시간이 지남에 따라 시간이 지남에 따라 서버의 일련의 디폴트의 '스냅 샷'으로 변경됩니다.주어진 스냅 샷은 해당 시간에 지정된 파일을 복원 할 수 있습니다.많은 데이터가 변경되면 객체 저장소의 백업이 매우 크고 때로는 이러한 변경 사항을 잊어 버릴 수 있습니다.백업에서 스냅 샷을 제거 할 수 있으며 RESTic은 시스템의 완전한 백업을 유지하기 위해 보존해야 할 데이터를 자동으로 파악하고 해당 스냅 샷의 변경 사항을 삭제합니다.Hostwinds Cloud Backups 기본값은 저장중인 60 개의 스냅 샷이지만 변경할 수 있습니다.

이전 스냅 샷을 제거하려면 두 가지 명령 만 실행하는 데 필요한 "잊어 버리는"및 "PRUNE"이하의 세부 사항이 아래에 있습니다.

restic과의 상호 작용과 마찬가지로 REPO를 먼저 초기화하여 repo 내에서 작업을 수행해야합니다.

# restic snapshots
password is correct
ID Date Host Tags Directory
----------------------------------------------------------------------
37f632eb 2018-02-22 11:32:43 hwkb.hostwindsdns.com all_databases.sql
b923eed6 2018-02-22 11:45:17 hwkb.hostwindsdns.com database_dump.sql
----------------------------------------------------------------------
2 snapshots

위의 예를 사용하여 2 개의 백업이 있습니다.스냅 샷을 제거하려면 위의 사용 가능한 스냅 샷의 첫 번째 항목 인 스냅 샷의 ID를 알아야합니다.

이 예에서는 ID가있는 두 번째 스냅 샷을 제거합니다. B923EED6.

# restic forget b923eed6
password is correct
storage ID 9babef79
removed snapshot b923eed6

다음으로, 당신은 restic 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
password is correct
create exclusive lock for repository
storage ID e7155fe8
load indexes
check all packs
check snapshots, trees and blobs
no errors were found

이제 백업 스냅 샷을 볼 때 제거한 항목이 더 이상 나열되지 않습니다.

# restic snapshots
password is correct
ID Date Host Tags Directory
----------------------------------------------------------------------
37f632eb 2018-02-22 11:32:43 hwkb.hostwindsdns.com all_databases.sql
----------------------------------------------------------------------
1 snapshots

작성자 Hostwinds Team  /  유월 5, 2021