-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.template
More file actions
61 lines (36 loc) · 3.23 KB
/
README.template
File metadata and controls
61 lines (36 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# btrgit
Interact with [btrfs](https://btrfs.wiki.kernel.org/index.php/Main_Page) snapshots made with [snapper](http://snapper.io/documentation.html) in a manner reminiscent of [git](https://git-scm.com/).
Search for changes to files and restore old versions of files. The output is designed to be useable by other command line tools.
Written and maintained by [Facet](https://www.facetframer.com/).
# Attribution
Adapted from [answers of server fault](http://serverfault.com/questions/399894/does-btrfs-have-an-efficient-way-to-compare-snapshots).
# Installing
```
pip install git+https://github.com/talwrii/btrgit#egg=btrgit
```
# Examples / Cheat sheet
```
# Show what changes have recently happened to home
btrgit log /home
# Show what changed in snapshot 443
btrgit log /home 443
```
# Usage
```
{usage}
```
# Discussion
[btrfs](https://btrfs.wiki.kernel.org/index.php/Main_Page) is an [open-source](https://opensource.org/) filesystem for the [linux](https://www.kernel.org/linux.html) operating system. Btrfs provides a feature called copy-on-write which allows files to be copied at virtual zero cost in terms of time and storage (see [Functional Data Structure](https://en.wikipedia.org/wiki/Purely_functional_data_structure).
This feature also allows the implementation of *snapshots*, complete copies filesystem at a particular point in time at very little cost. Snapshots have existing in other filesystems and surrounding utilities: notably [lvm](http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html), but the performance benefits of copy-on-write allows snapshots to be used far more aggressively.
[snapper](http://snapper.io/documentation.html) is one such tool that takes advantages of snapshots to produce an ordered history of how a filesystem has change.
The author found that he desired a more feature-complete interface to this history, and noting the similarity of of this concept to version control systems like [git](https://git-scm.com/) decided to write an interface more reminiscent of git.
# Alternatives and prior work
- An initial subset of features was adapted from [answers of server fault](http://serverfault.com/questions/399894/does-btrfs-have-an-efficient-way-to-compare-snapshots).
- This ideas here very much represents [snapper's](http://snapper.io/documentation.html) existing feature through the metaphor of [git](https://git-scm.com/)
- https://github.com/sysnux/btrfs-snapshots-diff.git was a pre-existing project to see the difference between btrfs snapshots
- [snapper gui](https://github.com/ricardomv/snapper-gui) is a gui which may well provide similar features.
- [zfs](https://docs.oracle.com/cd/E19253-01/819-5461/zfsover-2/index.html) is an open-source copy-on-write filesystem with similar features to btrfs that is used in production by various companies. Code for zfs is owned by Oracle. [Oracle has sued google using its copyright claims on another peice of open-source: Java](https://www.cnet.com/news/oracle-sues-google-over-android-and-java/). There is an (at the time of writing open) [issue for extending snapper to interact with zfs](https://github.com/openSUSE/snapper/issues/145)
)
Influenced by `git`
# Caveats
- This approach uses `btrfs subvolumes find-new`, there is an alternative approach using `btrfs receive`.