(no commit message)
[ikiwiki.git] / sandbox / testpage / index.mdwn
1 [[!toc  levels=3]]
2 # Introduction
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.
5
6 # Getting history records of a file
7
8 To get all history records of a file we will use hammer utility with 'history' command giving it 
9 file name as argument.
10
11         # echo "Hello" > test
12         # hammer history test
13         test    0000000110d66ec3 clean {
14            0000000110d6e970 04-Jan-2011 15:36:38
15         }
16
17         # echo "world" >> test
18         # hammer history test   
19         test    0000000110d66ec3 clean {
20            0000000110d6e970 04-Jan-2011 15:36:38
21            0000000110d6e9d0 04-Jan-2011 15:37:09
22         }
23
24         # echo "some more data" >> test
25         # hammer history 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
30         }
31
32 You probably wonder what are these strange hexadecimal numbers are:
33
34        0000000110d6e970
35            0000000110d6e9d0
36            0000000110d6ea10
37
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 
40 version.
41
42 #File restoring
43
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.
46
47         # hammer history test
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
52         }
53
54 Get data that refers to transaction id and put it in test.old
55         # undo -o test.old -t 0x0000000110d6e9d0 test
56         # cat test.old
57         Hello
58         world
59         # cat test
60         Hello
61         world
62         some more data