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
+53-19Lines changed: 53 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,43 @@
1
-
I make every 5 minutes a snapshot from my ZFS filesystem (keep it for 1 day).
1
+
# Background
2
+
3
+
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.
2
4
If i messed up a file, i need to search a clean state from the file in the snapshots - not always easy if don't realize it directly.
3
5
4
-
`zfs-snap-diff` is a little standalone tool (one executable with all inside) to help me for such cases.
6
+
`zfs-snap-diff` is a little tool to help me for such cases.
7
+
8
+
9
+
# Description
10
+
11
+
With `zfs-snap-diff` you can explore file differences from different zfs snapshots.
12
+
13
+
14
+
`zfs-snap-diff` has a web frontend, so it can run on your local work machine or on your remote file / backup server (no Xserver necesarry).
15
+
16
+
To keep it protable and independent, it's made as a single executable with all html / js stuff included.
17
+
The backend is implemented in golang, the frontend with [angularjs](https://angularjs.org), [bootstrap](http://getbootstrap.com) and [jsdifflib](https://github.com/cemerick/jsdifflib).
18
+
19
+
20
+
21
+
*!! it's in a very early dev state - only tested on FreeBSD !!*
5
22
6
-
!! it's in a very early dev state - only tested on FreeBSD !!
7
23
8
24
9
25
#Usage
10
26
27
+
28
+
### Startup a server instance
29
+
30
+
./zfs_snap_diff <ZFS_NAME>
31
+
32
+
### Connect with your web browser
33
+
34
+
http://localhost:12345
35
+
11
36
### Search a file
12
37
13
38
Search a file in the file browser.
14
39
15
-

40
+

16
41
17
42
### Select a file
18
43
@@ -33,9 +58,17 @@ When you select a snapshot, and
33
58
34
59

35
60
36
-
----
37
61
38
-
If you download a file from a snapshot, the generated name are: `<ORG_FILE_NAME>-<SNAPSHOT_NAME>.<FILE_SUFFIX>`.
62
+
63
+
#Notes
64
+
65
+
* if you download a file from a snapshot, the generated file name has the snapshot name included:
66
+
67
+
<ORG_FILE_NAME>-<SNAPSHOT_NAME>.<FILE_SUFFIX>
68
+
69
+
* for snapshot differences, you need to set the diff permission:
70
+
71
+
zfs allow -u <USER_NAME> diff <ZFS_NAME>
39
72
40
73
41
74
@@ -46,50 +79,51 @@ If you download a file from a snapshot, the generated name are: `<ORG_FILE_NAME>
46
79
47
80
* clone the repository
48
81
49
-
git clone github.com/j-keck/zfs-snap-diff
82
+
git clone github.com/j-keck/zfs-snap-diff
50
83
51
84
* change into the project directory
52
85
53
-
cd zfs-snap-diff
86
+
cd zfs-snap-diff
54
87
55
88
* init submodule
56
89
57
-
git submodule init
90
+
git submodule init
58
91
59
92
* update submodule
60
93
61
-
git submodule update
94
+
git submodule update
62
95
63
96
* generate golang src from static web content (this generates bindata.go)
64
97
65
-
go-bindata webapp/...
98
+
go-bindata webapp/...
66
99
67
100
* build it
68
101
69
-
go build -ldflags "-X main.VERSION $(git describe)"
102
+
go build -ldflags "-X main.VERSION $(git describe)"
70
103
71
104
72
105
73
106
# Run:
74
107
75
-
`./zfs-snap-diff <ZFS_NAME>`
76
-
77
-
* starts a web server on port 127.0.0.1:12345
78
-
* all html / javascript files included (including bootstrap, jquery, angularjs, jsdifflib)
108
+
./zfs-snap-diff <ZFS_NAME>
79
109
110
+
* starts a web server on port http://127.0.0.1:12345
0 commit comments