-
Notifications
You must be signed in to change notification settings - Fork 1
/
nb.1
116 lines (87 loc) · 2.52 KB
/
nb.1
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.TH nb 1 "25 September 2023" "nano-backup 0.6.0"
.SH NAME
nb - A minimal backup tool for POSIX systems
.SH SYNOPSIS
nb /path/to/repo [ARGUMENT]...
.SH DESCRIPTION
nb is a tool for tracking and managing changes in files.
To do a backup, run nb with the path to the repository as argument.
.SH ARGUMENTS
Various arguments can be passed to nb in addition to the repository path:
.TP
gc
Run the garbage collector on the given repository to delete unneeded files.
Garbage collection is done automatically after every backup.
.TP
integrity
Check the integrity of all stored files in the repository.
.TP
NUMBER [PATH]
Restore PATH to the state of the backup NUMBER. 0 is the latest backup, 1
the backup before it, etc. Omitting PATH will restore everything. This
number will be ignored for copied/mirrored files, which will always be
restored to their latest state.
.SH CONFIGURATION
Each repository contains a file named "config". It has the following
syntax:
.nf
# Comment.
[policy]
/home/user/file.txt
/home/user//regular-expression
/home/user//regular-expression/file.txt
.fi
Paths must be absolute. A double slash in a path denotes a POSIX extended
regular expression. This expression will not match recursively and can be
terminated by a slash.
Policies only apply to the last element of a path:
.nf
[mirror]
/home/user/last-element/
.fi
Symlinks are not followed, unless they correspond to a parent directory in
a configured path. In the following example "home" and "user" will be
followed, while "dir" and everything inside it will not:
.nf
[copy]
/home/user/dir/
.fi
.SH POLICIES
.TP
copy
Backup only the latest version of a file.
.TP
mirror
Like copy, but if a file gets removed from the system, it will also be
removed from the backup.
.TP
track
Keep a full history of every change.
.TP
ignore
Allows specifying regular expressions for excluding paths. These
expressions will be matched against full, absolute paths. The ignore policy
has a lower priority than the others:
.nf
[copy]
/home//^foo.txt$
[ignore]
^/home/.*$
.fi
"foo.txt" will still be backed up, because it was explicitly matched by a
copy rule.
.TP
summarize
Allows specifying regular expressions for directories which should not be
listed recursively during a backup. These expressions will be matched
against full, absolute paths.
.nf
[summarize]
/\.git$
# Summaries do not apply to implicit parent nodes with no direct policy:
[track]
/home/user/projects/.git/config
# ^---- implicit ----^
.fi
.SH AUTHOR
Copyright (c) 2023 Alexander Heinrich