3 The purpose of this document is to demonstarate to the reader how to restore data on a hammer
4 filesystem(files/directories). This will also cover how to adjust history retention.
6 # Getting history records of a file
8 To get all history records of a file we will use hammer utility with 'history' command giving it
13 test 0000000110d66ec3 clean {
14 0000000110d6e970 04-Jan-2011 15:36:38
17 # echo "world" >> test
19 test 0000000110d66ec3 clean {
20 0000000110d6e970 04-Jan-2011 15:36:38
21 0000000110d6e9d0 04-Jan-2011 15:37:09
24 # echo "some more data" >> test
26 test 0000000110d66ec3 clean {
27 0000000110d6e970 04-Jan-2011 15:36:38
28 0000000110d6e9d0 04-Jan-2011 15:37:09
29 0000000110d6ea10 04-Jan-2011 15:37:40
32 You probably wonder what are these strange hexadecimal numbers are:
38 Well, they are transaction ids. Transaction id is a 64 bit hexadecimal number used by hammer file
39 system to refer to historical file or directory data.You will need them to restore file to a prior
44 To restore a file to a prior version we will use 'undo' utility. For example lets restore the test
45 file to it's prior version created in previous section.
48 test 0000000110d66ec3 clean {
49 0000000110d6e970 04-Jan-2011 15:36:38
50 0000000110d6e9d0 04-Jan-2011 15:37:09
51 0000000110d6ea10 04-Jan-2011 15:37:40
54 Get data that refers to transaction id and put it in test.old
56 # undo -o test.old -t 0x0000000110d6e9d0 test
65 You can aslo specify the 'd' flag and get a diff output
67 # undo -d -o test.diff -t 0x0000000110d6e9d0 test
69 --- test@@0x000000110d6e9d0 2010-01-04 15:36:31 -0600
70 +++ test 2011-01-04 15:37:32 -0600