Skip to content

mc rewind attempts

Allan Roger Reid edited this page Apr 17, 2024 · 1 revision

Breakdown

mc rm --recursive --force --dangerous --versions acme/files
mc rm --recursive --force --dangerous --versions acme/files-recovered
mc rb acme/files
mc rb acme/files-recovered

Setup

mc mb acme/files
mc mb acme/files-recovered
mc version enable acme/files
mc version enable acme/files-recovered

Write data

echo "note original" | mc pipe acme/files/notes.txt
date
sleep 1
echo "note good" | mc pipe acme/files/notes.txt
date
sleep 1
echo "note corrupt" | mc pipe acme/files/notes.txt
date

Observe system state

mc cat acme/files/notes.txt
note corrupt

mc ls --versions acme/files

[2024-04-17 23:17:01 UTC] 13B STANDARD 044308e0-61f7-416c-9433-fc798959b851 v3 PUT notes.txt [2024-04-17 23:16:59 UTC] 10B STANDARD e18e9144-4707-4a4a-a54e-b5c508a495b7 v2 PUT notes.txt [2024-04-17 23:16:58 UTC] 14B STANDARD 2e492d4e-65e4-49d8-af7a-2035497b4bee v1 PUT notes.txt


mc ls --rewind "2024.04.17T23:17:01" --versions acme/files

[2024-04-17 23:16:59 UTC] 10B STANDARD e18e9144-4707-4a4a-a54e-b5c508a495b7 v2 PUT notes.txt [2024-04-17 23:16:58 UTC] 14B STANDARD 2e492d4e-65e4-49d8-af7a-2035497b4bee v1 PUT notes.txt


Select 'uncorrupted data' by point in time

mc cp --recursive --rewind "2024.04.17T23:17:01" acme/files/ acme/files-recovered


Observe current system state

mc cat acme/files-recovered/notes.txt

note good

mc ls --versions acme/files-recovered

[2024-04-17 23:18:54 UTC] 10B STANDARD 60dd6c13-5048-4507-badc-1804a72c12d0 v1 PUT notes.txt

Clone this wiki locally