Alexander Neumann
b85927576b
Address code review comments
2015-07-26 18:01:20 +02:00
Alexander Neumann
d1629e1e4e
fuse: move to top level
2015-07-26 17:20:26 +02:00
Alexander Neumann
bd746a0425
fuse: refactor and add tests for fuse.file
2015-07-26 16:43:42 +02:00
Alexander Neumann
9753c37e31
Remove dead code
...
This removes dead code (functions that aren't called) detected with
`deadcode`.
2015-07-26 14:56:34 +02:00
Alexander Neumann
55ddd5317d
Reduce memory usage for fuse mount
...
This changes `repository.LoadBlob()` so that a destination buffer must
be provided, which enables the fuse code to use a buffer from a
`sync.Pool`. In addition, release the buffers when the file is closed.
At the moment, the max memory usage is defined by the max file size that
is read in one go (e.g. with `cat`). It could be further optimized by
implementing a LRU caching scheme.
2015-07-26 14:25:59 +02:00
Alexander Neumann
054256468b
Fix message display for parent snapshot id
2015-07-25 18:10:23 +02:00
Alexander Neumann
5cdcc99eba
Use array instead of hash for backend.ID
...
Since backend.ID is always a slice of constant length, use an array
instead of a slice. Mostly, arrays behave as slices, except that an
array cannot be nil, so use `*backend.ID` insteaf of `backend.ID` in
places where the absence of an ID is possible (e.g. for the Subtree of a
Node, which may not present when the node is a file node).
This change allows to directly use backend.ID as the the key for a map,
so that arbitrary data structures (e.g. a Set implemented as a
map[backend.ID]struct{}) can easily be formed.
2015-07-25 18:01:57 +02:00
Alexander Neumann
deaca157fe
restore: ignore errors
...
Also add a test for restoring a file that is owned by root. Closes #244 .
2015-07-25 12:59:59 +02:00
Alexander Neumann
cc34401152
Record exclude patterns in snapshot
...
This adds the exclude patterns used to create a backup in the snapshot,
so we can later compute statistics (like git does) on the data
structure, e.g. added/removed files etc. For that, we need the exclude
pattern.
2015-07-22 22:43:32 +02:00
Alexander Neumann
9911d46996
fuse: rename child/children -> node/items
2015-07-21 21:34:59 +02:00
Alexander Neumann
3f4b5b8d48
fuse/mount: display symlinks properly
2015-07-21 21:25:05 +02:00
Alexander Neumann
1ac72b8813
Fix style issue
2015-07-21 21:24:06 +02:00
Alexander Neumann
99dae57b4f
fuse: use node.Type instead of node.Mode
2015-07-21 21:23:40 +02:00
Alexander Neumann
aeb5a694d3
Merge pull request #238 from restic/fix-checks-on-bsd
...
Refactor skipping symlink timestamp checks on *bsd and darwin
2015-07-21 19:47:33 +02:00
Alexander Neumann
258b6a77ee
Refactor skipping symlink ModTime checks, add OpenBSD
2015-07-20 21:29:21 +02:00
Alexander Neumann
bd3ce5d4a3
Fix tests on freebsd
2015-07-20 21:08:29 +02:00
Alexander Neumann
1da89253cf
Add include filter for restore
...
Include and exclude filter are mutually exclusive.
2015-07-20 19:21:01 +02:00
Alexander Neumann
c0337a2675
Add exclude filter to restorer and 'restore' command
2015-07-20 19:21:01 +02:00
Alexander Neumann
7fd52f9f57
Add exclude filter to archiver and 'backup' command
2015-07-20 19:21:01 +02:00
Matthieu Rakotojaona
3767eb2675
Unmount and remove directory for mount in tests
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
e44716381c
Unmount when closing application from cli
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
eadfcd3f9e
Add waitForMount for OSX
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
fe6f1c01f3
Make inodeFromBackendId more explicit
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
a4d122e5ae
Cleanup mount after test
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
d7888d4dd5
Fix checks in fuse tests
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
ca6b7ec533
Add Index.LookupSize
2015-07-19 23:04:18 +02:00
Matthieu Rakotojaona
b1426826cc
Extract fuse structs
2015-07-19 23:03:33 +02:00
Matthieu Rakotojaona
0606b9884e
Make file.Read more intelligible
2015-07-19 23:03:33 +02:00
Matthieu Rakotojaona
3731a94367
Use functions to create names
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
a016f82051
Fix coding style
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
e654a9659c
Protect the snapshots cache with a RWMutex
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
0e7c1668d5
Make mountpoint readable by owner only
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
9ff98d34ef
Add build and test instructions
...
* Don't build on openbsd
* Don't test fuse on travis
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
1f79a19293
Comment the go trick about static verification of a struct implementing an interface
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
a8cd74ba7e
Cache known snapshots instead of re-traversing the repository every time
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
c9b3eebc09
Check that mountpoints are created
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
25b090a074
Add integration tests for mount command
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
414ade5b3f
Signal readiness of mount to potential callers
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
a6ce7d9845
Use more restic-y idioms
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
3a82612244
Update bazil.org/fuse version
2015-07-19 23:03:32 +02:00
Matthieu Rakotojaona
32a321e51e
Add simple mount command
2015-07-19 23:03:32 +02:00
Alexander Neumann
76817da922
Run cleanup handlers in main function
2015-07-19 17:57:18 +02:00
Alexander Neumann
dac89bf544
Allow more than one cleanup handler
2015-07-19 17:50:55 +02:00
Alexander Neumann
159b9e80c4
cmd/restic: implement lock refresh
2015-07-12 22:10:01 +02:00
Alexander Neumann
d36f07c6eb
checker: add option to remove orphaned packs
2015-07-12 17:14:10 +02:00
Alexander Neumann
af02c323cd
checker: use channel of error instead of slice
2015-07-12 01:46:10 +02:00
Alexander Neumann
04f172b38d
checker: Add checker and tests
2015-07-11 16:27:41 +02:00
Alexander Neumann
54c4c29a89
Add checker and command 'check' to replace 'fsck'
2015-07-11 16:27:38 +02:00
Alexander Neumann
389ec9b101
Add tests for restore filter
2015-07-09 20:12:31 +02:00
Alexander Neumann
3e0a97fb13
Fix restore filter
...
Internally rename restorer.Filter -> restorer.SelectForRestore to make
semantic clear.
In addition, swap parameters to filepath.Match() so that the pattern can
really be matched.
Limitation: The filter only works on the filename, not on any path
component, e.g. '*.go' selects all go files, 'subdir/foo*' doesn't
select anything.
Fixes #202 .
2015-07-09 20:12:31 +02:00
Florian Weingarten
c2d5a9209e
fix darwin integration tests
2015-07-09 11:13:40 -04:00
Alexander Neumann
57eb1a4eea
cmd_backup: filter non-existing target files/dirs
2015-07-06 23:02:16 +02:00
Alexander Neumann
c8bb688e26
Command snapshots
: do not list first dir twice
2015-07-06 22:26:31 +02:00
Alexander Neumann
03983f0907
repository: Rename Load() -> LoadAndDecrypt()
2015-07-05 11:07:10 +02:00
Alexander Neumann
281eea9c05
sftp: Use own process group for ssh subprocess
2015-07-05 11:07:10 +02:00
Alexander Neumann
e657287eac
cmd/restic: Add command unlock
, improve error message
2015-06-28 13:52:23 +02:00
Alexander Neumann
47212dde8c
cmd/restic: Do not require exclusive lock for listing keys
2015-06-28 13:52:22 +02:00
Alexander Neumann
13e9a35f96
cmd/restic: Add lock handling, interrupt cleanup
2015-06-28 13:52:22 +02:00
Alexander Neumann
65a0def949
cmd/restic: Add locks to commands
2015-06-28 13:52:22 +02:00
Alexander Neumann
7d2699b429
cmd/restic: Rename variable, no functional changes
2015-06-28 13:52:22 +02:00
Alexander Neumann
d51fd436b5
Add locking functions
2015-06-28 13:52:22 +02:00
Florian Weingarten
f8c30556d3
Ask for password after create repo succeeded
2015-06-26 13:58:43 -04:00
Alexander Neumann
9e9177ab73
Add build.go
2015-06-24 20:29:58 +02:00
Alexander Neumann
d5020ac109
Fix debug functions
2015-06-24 20:00:01 +02:00
Alexander Neumann
6c2d6bfd11
Merge pull request #184 from howeyc/backend-s3
...
Add Amazon S3 backend.
2015-06-23 20:14:47 +02:00
Alexander Neumann
0005191d71
Remove dirdiff
and gentestdata
2015-06-21 17:40:22 +02:00
Alexander Neumann
5ae04b6834
Add last integration tests, remove testsuite
2015-06-21 17:40:22 +02:00
Alexander Neumann
43d4558a90
Add test for backing up non-existing directories
2015-06-21 17:40:22 +02:00
Alexander Neumann
675f341b6d
Output warnings/errors to configurable writer
2015-06-21 17:40:22 +02:00
Alexander Neumann
cfaf8ab8a6
Add integration test for key handling
2015-06-21 17:40:22 +02:00
Alexander Neumann
a99a460b32
Fix integration tests
2015-06-21 17:40:22 +02:00
Alexander Neumann
a43733d552
Introduce Verbosef
2015-06-21 17:40:22 +02:00
Alexander Neumann
4388474cdc
Restructure cmd/restic
, no functional changes
2015-06-21 17:40:22 +02:00
Alexander Neumann
2fa259816b
rename opts
to mainOpts
2015-06-21 17:40:22 +02:00
Alexander Neumann
1216ded14b
Add integration test for key command
2015-06-21 17:40:22 +02:00
Alexander Neumann
e2563b3eca
Fix comments
2015-06-21 17:40:22 +02:00
Alexander Neumann
a176b1b5a6
Add more integration tests
2015-06-21 17:40:22 +02:00
Alexander Neumann
9853fbcf48
Remove more flags from tests
2015-06-21 17:40:21 +02:00
Alexander Neumann
3a65f27c3f
Automatically find fixtures for integration test
2015-06-21 17:40:21 +02:00
Alexander Neumann
030f08a410
Remove flags from tests
2015-06-21 17:40:21 +02:00
Alexander Neumann
d8d09b6d69
Fix restic configuration for integration tests
2015-06-21 17:40:21 +02:00
Alexander Neumann
12677b4f8a
Use flag instead of build tag to run integration tests
2015-06-21 17:40:21 +02:00
Alexander Neumann
7c107acf0b
More integration tests
2015-06-21 17:40:21 +02:00
Alexander Neumann
954025e399
Add integration test with the go testing framework
2015-06-21 17:40:21 +02:00
Chris Howey
47186806cf
Add Amazon S3 backend.
2015-06-14 08:28:50 -05:00
Alexander Neumann
9c375ea382
Refactor backup a bit
2015-06-07 19:08:37 +02:00
Alexander Neumann
fd80499954
Refactor terminal recognition, add --quiet parameter
2015-06-07 18:30:11 +02:00
Alexander Neumann
f5537e7a0e
Refactor configuration of cache dir and repository
2015-06-07 18:15:03 +02:00
Alexander Neumann
848793df84
Remove unused file
2015-06-07 18:13:22 +02:00
Alexander Neumann
0314d2b0c3
fsck: Fix check for orphaned blobs
2015-05-17 23:41:53 +02:00
Alexander Neumann
df1e3e03e9
Add 'dump' command
...
'dump' writes internal data structes pretty-printed as JSON to stdout.
This was done to debug fsck error messages.
In contrast to the 'cat' command, this one prints the data structures as
there are interpreted by restic, not as they are stored in the
repository. This means that only the merged index from all the index
files is printed out.
This is meant for debugging only, it's compiled only when the "debug"
tag is active.
2015-05-17 23:15:08 +02:00
Alexander Neumann
af381c2ab0
Remove Repository.Remove()
2015-05-17 20:58:22 +02:00
Alexander Neumann
eb6dfcf58c
Remove Repository.Test()
2015-05-17 20:58:22 +02:00
Alexander Neumann
6e38a8a033
Move FindSnapshot, make Repository.List() return IDs
2015-05-17 20:58:22 +02:00
Florian Weingarten
bace4607bf
Fix ModTime for directories
2015-05-13 23:11:31 -04:00
Alexander Neumann
95536e8a21
Rename 'Repo' -> 'Repository'
2015-05-09 23:59:58 +02:00
Alexander Neumann
232c472836
Move package 'repo' to package 'repository'
2015-05-09 23:52:03 +02:00
Alexander Neumann
b2dcdf00e3
Merge pull request #178 from restic/refactor-server
...
Rename Server -> Repository
2015-05-09 22:59:02 +02:00
Alexander Neumann
ae21938f3e
Rename 'Repository' -> Repo
2015-05-09 17:41:28 +02:00
Alexander Neumann
cd4c56b927
wip
2015-05-09 13:54:47 +02:00