You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-32Lines changed: 39 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,7 @@
1
+
# `zfs-snap-diff`: compare / restore files from zfs snapshots
1
2
Next features of `zfs-snap-diff`: [feature poll](https://github.com/j-keck/zfs-snap-diff/issues?q=is%3Aissue+is%3Aopen+label%3Afeature-poll). Please comment / vote.
2
3
3
-
# Background
4
-
5
-
I make every 5 minutes a snapshot (keep it for 1 day) and once a day for long term (keep it for one month) from my home partition on a ZFS filesystem.
6
-
If i messed up a file, i need to search a clean state from the file in the snapshots - not always easy if i don't realize it directly.
7
-
8
-
`zfs-snap-diff` is a little tool to help me for such cases.
9
-
10
-
11
-
# Description
4
+
## Description
12
5
13
6
With `zfs-snap-diff` you can explore file differences and restore changes from older file versions in different zfs snapshots.
14
7
You can restore the whole file from a older version, or select single changes to revert in the 'Diff' view.
@@ -21,10 +14,10 @@ The backend is implemented in golang, the frontend with [angularjs](https://angu
21
14
22
15
23
16
24
-
#Usage
17
+
##Usage
18
+
_under linux, you need the '-use-sudo' flag if you don't run it as root - see the options below_
25
19
26
-
27
-
## Startup a server instance
20
+
### Startup a server instance
28
21
29
22
./zfs-snap-diff [OPT_ARGS] <ZFS_NAME>
30
23
@@ -55,45 +48,47 @@ The backend is implemented in golang, the frontend with [angularjs](https://angu
55
48
56
49
57
50
58
-
## Connect with your web browser
51
+
###Connect with your web browser
59
52
60
53
http://localhost:12345
61
54
62
55
63
-
64
-
## Browse actual filesystem state
65
56
66
-
### Select a dataset
57
+
## User guide
58
+
59
+
### Browse actual filesystem state
60
+
61
+
#### Select a dataset
67
62
68
63
Select a dataset which you would explore. If you start `zfs-snap-diff` on a dataset with no childrens, the current dataset are selected.
69
64
70
65

71
66
72
67
73
-
### Search a file
68
+
####Search a file
74
69
75
70
Search a file to compare in the file browser.
76
71
77
72

78
73
79
74
80
75
81
-
### Select a file
76
+
####Select a file
82
77
83
78
When a file is selected, `zsd-snap-diff` search all snapshots where the selected file was modified (it compares text files per md5, others per size+modTime).
84
79
85
80

86
81
87
82
88
-
### Select a snapshot
83
+
####Select a snapshot
89
84
90
85
When you select a snapshot, you can view, diff, download or restore the file from the selected snapshot.
91
86
92
-
##### View
87
+
######View
93
88
View the file content from an older file version.
94
89

95
90
96
-
##### Diff
91
+
######Diff
97
92
Explore file differences and pick single changes to revert.
98
93
99
94
intext diff:
@@ -105,16 +100,16 @@ side by side diff:
105
100
106
101
107
102
108
-
## Browse snapshot state
103
+
###Browse snapshot state
109
104
110
-
### Search a snaphot
105
+
####Search a snaphot
111
106
112
107
Search a snapshot in the snapshot browser. All snapshots from the selected dataset are displayed in this view.
113
108
114
109

115
110
116
111
117
-
### Select a snapshot
112
+
####Select a snapshot
118
113
119
114
When a snapshot is selected, the file-browser shows the content from this snapshot.
120
115
@@ -129,15 +124,15 @@ From here you can easy view / restore a deleted file.
129
124
130
125
131
126
132
-
# Installation
127
+
##Installation
133
128
134
-
## Prebuild
129
+
###Prebuild
135
130
136
131
Get a package for your platform from: https://github.com/j-keck/zfs-snap-diff/releases/latest
137
132
138
133
*ping me if your platform is missing*
139
134
140
-
## Manual build
135
+
###Manual build
141
136
142
137
* clone the repository
143
138
@@ -151,24 +146,28 @@ From here you can easy view / restore a deleted file.
151
146
152
147
./build.pl build
153
148
154
-
155
-
#Notes
149
+
* run it
150
+
151
+
./zfs-snap-diff <ZFS_NAME>
152
+
153
+
154
+
##Notes
156
155
157
156
* if you download a file from a snapshot, the generated file name has the snapshot name included:
158
157
159
158
<ORG_FILE_NAME>-<SNAPSHOT_NAME>.<FILE_SUFFIX>
160
159
161
160
* if you restore / patch a file, the orginal file will be saved under:
162
161
163
-
./zsd/<ORG_FLILE_NAME>_<TIMESTAMP>
162
+
<ORG_FILE_PATH>/.zsd/<ORG_FLILE_NAME>_<TIMESTAMP>
164
163
165
164
* for snapshot differences (Browse snapshot diff), you need to set the diff permission:
166
165
167
166
zfs allow -u <USER_NAME> diff <ZFS_NAME>
168
167
169
168
170
169
171
-
# Coding Notes
170
+
##Coding Notes
172
171
173
172
* if you change something under 'webapp/'
174
173
@@ -179,10 +178,18 @@ From here you can easy view / restore a deleted file.
179
178
* ./build.pl build
180
179
181
180
182
-
# Changelog
181
+
##Changelog
183
182
184
183
###0.0.X###
185
184
185
+
0.0.9:
186
+
* show file size and modify timestamp in the file-browser
187
+
* list directories at first in the file-browser
188
+
* sortable columns in the file-browser
189
+
* only regular files / directories are clickable
190
+
191
+
[all commits from 0.0.8...0.0.9](https://github.com/j-keck/zfs-snap-diff/compare/0.0.8...0.0.9)
192
+
186
193
0.0.8:
187
194
* dataset selectable in 'browse-actual' view
188
195
* add size informations to dataset (to match 'zfs list' output)
0 commit comments