File: README

package info (click to toggle)
obnam 1.21-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,032 kB
  • ctags: 2,505
  • sloc: python: 14,404; sh: 410; ansic: 252; makefile: 66; awk: 5
file content (188 lines) | stat: -rw-r--r-- 6,506 bytes parent folder | download | duplicates (2)
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
Obnam, a backup program
=======================

Obnam is a backup program.


Home page
---------

The Obnam home page is at <http://obnam.org/>, see there
for more information.


Installation
------------

The source tree contains packaging for Debian. Run `debuild -us -uc -i.git` to
build an installation package.

On other systems, using the `setup.py` file should work: run
"python setup.py --help" for advice. If not, please report a bug.
(I've only tested `setup.py` enough for to build the Debian package.)

You need Python 2.6 or 2.7 (Python 3 is not yet supported). You also
need to install my Python B-tree library, and some of my other
libraries and tools, which you can get from:

* <http://liw.fi/larch/>
* <http://liw.fi/ttystatus/>
* <http://liw.fi/coverage-test-runner/> (for automatic tests)
* <http://liw.fi/tracing/>
* <http://liw.fi/cliapp/>
* <http://liw.fi/genbackupdata/>
* <http://liw.fi/summain/>
* <http://liw.fi/cmdtest/>
* <http://liw.fi/seivot/> (for benchmarks)

You also need third party libraries:

* paramiko: <http://www.lag.net/paramiko/>

See debian/control for the full set of build dependencies and runtime
dependencies on a Debian system. (That set actually gets tested. The
above list is maintained manually and may get out of date from time
to time.)

If you want to run obnam from the repository directory (rather than installing
it), you need to do some setup.  Run `./check --unit-tests` for setup and
to verify with unit tests or `./check --help` to setup without any tests.
You'll need dev files for python and the Coverage Test Runner python module (on
Debian, those are the python-dev and python-coverage-test-runner packages).

Use
---

To get a quick help summary of options:

    ./obnam --help

To make a backup:

    ./obnam backup --repository /tmp/mybackup $HOME

For more information, see the manual page:

    man -l obnam.1


Hacking
-------

Obnam source code is stored in git for version control purposes;
you can get a copy as follows:

    git clone git://git.liw.fi/obnam

The 'master' branch is the main development one. Any bug fixes and
features should be developed in a dedicated branch, which gets merged
to master when the changes are done and considered good.

To build and run automatic tests:

    ./check
    ./check --unit-tests # unit tests only, no black box tests
    ./check --network # requires ssh access to localhost

`check` is a wrapper around `python setup.py`, but since using that
takes several steps, the script makes things easier.

You need my CoverageTestRunner to run tests, see above for where to get it.  A
couple of scripts exist to run benchmarks and profiles:

    ./metadata-speed 10000
    ./obnam-benchmark --size=1m/100k --results /tmp/benchmark-results
    viewprof /tmp/benchmark-results/*/*backup-0.prof
    seivots-summary /tmp/benchmark-results/*/*.seivot | less -S

There are two kinds of results: Python profiling output, and `.seivot`
files.

For the former, `viewprof` is a little helper script I wrote,
around the Python pstats module.
You can use your own, or get mine from extrautils
(<http://liw.fi/extrautils/>). Running the benchmarks under profiling
makes them a little slower (typically around 10% for me, when I've
compared), but that's OK: the absolute numbers of the benchmarks are
less important than the relative ones. It's nice to be able to look at
the profiler output, if a benchmark is surprisingly slow, without
having to re-run it.

`seivots-summary` is a tool to display summaries of the measurements
made during a benchmark run. `seivot` is the tool that makes the
measurements. I typically save a number of benchmark results, so that
I can see how my changes affect performance over time.

If you make any changes, I welcome patches, either as plain diffs,
`git format-patch --cover-letter` mails, or public repositories I can
merge from.

I would really appreciate if patches for new features and bug fixes
would update the test suite and documentation as well.

The code layout is roughly like this:

    obnamlib/               # all the real code
    obnamlib/plugins/       # the plugin code (see pluginmgr.py)
    obnam                   # script to invoke obnam
    _obnammodule.c          # wrapper around some system calls

In obnamlib, every code module has a corresponding test module,
and "make check" uses CoverageTestRunner to run them pairwise. For
each pair, test coverage must be 100% or the test will fail.
Mark statements that should not be included in coverage test with
"# pragma: no cover", if you really, really can't write a test.
without-tests lists modules that have no test modules.

Feedback
--------

I welcome bug fixes, enhancements, bug reports, suggestions,
requests, and other feedback. I prefer e-mail the mailing list: see
<http://obnam.org/contact/> for details.

It would be helpful if you can run `make clean check` before submitting
a patch, but it is not strictly required.

Note that to run the test suite you will need the following installed:

* pep8
* coverage
* CoverageTestRunner ( http://liw.fi/coverage-test-runner/ )
  (python-coverage-test-runner on Debian)


Legal stuff
-----------

Most of the code is written by Lars Wirzenius. (Please provide patches
so that can change.)

This entire work is covered by the GNU General Public
License, version 3 or later.

> Copyright 2010-2015  Lars Wirzenius
> 
> This program is free software: you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation, either version 3 of the License, or
> (at your option) any later version.
> 
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> GNU General Public License for more details.
> 
> You should have received a copy of the GNU General Public License
> along with this program.  If not, see <http://www.gnu.org/licenses/>.

A copy of the GPL is included in the file `COPYING` in the source tree.

The manual (all the contents of the `manual` subdirectory) is
additionally licensed under a Creative Commons Attribution 4.0
International License. You can choose whether to use the GPL or the CC
license for the manual.

A copy of the Creative Commons license is included in the file
`CC-BY-SA-4.0.txt` in the source tree, and can be viewed online
at <http://creativecommons.org/licenses/by-sa/4.0/legalcode>.