1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 01:37:20 +00:00
Commit graph

823 commits

Author SHA1 Message Date
Thomas Waldmann
a44eecb05e Merge branch 'issue_183' into merge 2015-04-21 20:51:17 +02:00
Thomas Waldmann
38dd086e30 Revert "fix "attic info" all archives stats, fixes #183"
Fixed by jborg in master in a different way.

This reverts commit 212777d716.
2015-04-21 20:50:19 +02:00
Thomas Waldmann
bbe200f41b fix incomplete merge of delete_repo branch 2015-04-21 11:34:13 +02:00
Jonas Borgström
ed9475d7cd Fix cache object reference 2015-04-20 00:07:26 +02:00
Jonas Borgström
29646a646d Merge pull request #258 from ThomasWaldmann/platform_linux_optimize
linux: remove duplicate os.fsencode calls
2015-04-20 00:05:12 +02:00
Jonas Borgström
35458ff5d6 Merge pull request #288 from ThomasWaldmann/no_os.uname
use sys.platform everywhere, fixes #188
2015-04-20 00:01:02 +02:00
Thomas Waldmann
80dad2df61 use sys.platform everywhere, fixes #188
os.uname is UNIX-only, sys.platform is portable.

note:
- this doesn't implicate attic will now work on windows.
- windows is untested / unsupported and there might be a lot of other issues left.
- attic's xattr module already used sys.platform, so this is better for internal consistency also.
2015-04-19 23:54:44 +02:00
Jonas Borgström
dd0c69ac32 Fix "All archives" output for attic info
Closes #183
2015-04-19 23:45:05 +02:00
Jonas Borgström
04d50c7141 Removed some unused imports 2015-04-19 23:24:14 +02:00
Jonas Borgström
b7e6efbfc5 Added missing import of parse_timestamp 2015-04-19 23:21:46 +02:00
Jonas Borgström
b61ba51c0d More user friendly error message when repository key file is not found
Closes #236
2015-04-19 23:09:36 +02:00
Jonas Borgström
af9f1c24c4 Fix parsing of iso8601 timestamps with zero microseconds
Closes #282
2015-04-19 22:42:52 +02:00
Thomas Waldmann
b2147c14d6 updated CHANGES-merge.txt 2015-04-19 19:56:48 +02:00
Thomas Waldmann
82681d6ecb PR #287 - Merge branch 'issue_183' into merge 2015-04-19 18:54:19 +02:00
Thomas Waldmann
212777d716 fix "attic info" all archives stats, fixes #183
the problem was that calc_stats() dirties cache.chunks by decrementing
the chunk reference counters (so it can compute the deduplicated size
of the archive correctly).

the fix is to create a local Cache instance inside calc_stats, so the dirty cache
instance can not be used elsewhere.

also:
fix internal consistency of calc_stats function: always use "cache" (not "self.cache").
minor cosmetic pep8 fixes
2015-04-19 18:50:10 +02:00
Thomas Waldmann
310f9b7412 PR #285 - Merge branch 'archive_timestamp' into merge 2015-04-18 21:43:47 +02:00
Thomas Waldmann
0ffee1f1ee implement --timestamp, iso8601-like utc timestamp string or reference file/dir
note: this needs bug #282 to be fixed first, because it will create timestamps with microseconds==0.
2015-04-18 21:36:10 +02:00
Thomas Waldmann
99d15157d2 PR #284 updated - Merge branch 'sparse_files' into merge 2015-04-18 01:16:26 +02:00
Thomas Waldmann
ee80db4eb2 add commandline argument --sparse
default is to not create sparse files.

if you give --sparse, it will create a hole in the sparse output file when a all-zero chunk is extracted.
2015-04-17 22:28:40 +02:00
Thomas Waldmann
fc97099924 Merge branch 'master' into merge 2015-04-15 23:04:34 +02:00
Jonas Borgström
e815d6da8e acl/xattr: Be less strict about unknown platforms
Closes #239
2015-04-15 21:49:03 +02:00
Jonas Borgström
848666e7cb cache: Treat EOFError as a negative _confirm answer 2015-04-15 21:35:56 +02:00
Thomas Waldmann
118fb1a55c PR #226 - Merge branch 'delete_repo' into merge 2015-04-15 19:05:58 +02:00
Thomas Waldmann
b6ed1c742b PR #284 - Merge branch 'sparse_files' into merge 2015-04-15 16:43:07 +02:00
Thomas Waldmann
a2bf2aea22 simple sparse file support, made chunk buffer size flexible
Implemented sparse file support to remove this blocker for people backing up lots of
huge sparse files (like VM images). Attic could not support this use case yet as it would
have restored all files to their fully expanded size, possibly running out of disk space if
the total expanded size would be bigger than the available space.

Please note that this is a very simple implementation of sparse file support - at backup time,
it does not do anything special (it just reads all these zero bytes, chunks, compresses and
encrypts them as usual). At restore time, it detects chunks that are completely filled with zeros
and does a seek on the output file rather than a normal data write, so it creates a hole in
a sparse file. The chunk size for these all-zero chunks is currently 10MiB, so it'll create holes
of multiples of that size (depends also a bit on fs block size, alignment, previously written data).

Special cases like sparse files starting and/or ending with a hole are supported.

Please note that it will currently always create sparse files at restore time if it detects all-zero
chunks.

Also improved:
I needed a constant for the max. chunk size, so I introduced CHUNK_MAX (see also
existing CHUNK_MIN) for the maximum chunk size (which is the same as the chunk
buffer size).

Attic still always uses 10MiB chunk buffer size now, but it could be changed now more easily.
2015-04-15 16:29:18 +02:00
Thomas Waldmann
2f71b39866 PR #283 - Merge branch 'fix-missing-microseconds' of https://github.com/camh-/attic into merge 2015-04-15 03:06:50 +02:00
Thomas Waldmann
3a382e9b46 Merge branch 'master' into merge 2015-04-15 02:41:55 +02:00
Jonas Borgström
bbc8886bfe Updated CHANGES
Closes #163.
2015-04-13 23:29:29 +02:00
Jonas Borgström
27012a50e5 Merge remote-tracking branch 'adept/patch-1' 2015-04-13 23:28:28 +02:00
Jonas Borgström
70af748363 Added Thomas Waldmann to AUTHORS and updated CHANGES 2015-04-13 23:12:30 +02:00
Jonas Borgström
8227e4788a Merge remote-tracking branch 'tw/fix_pipe' 2015-04-13 23:08:05 +02:00
Jonas Borgström
20026e58aa Fix incorrect behaviour with two character directory names.
Independetely found and fixed by both Thomas Waldemann and
Cam Hutchison. Closes #265 and #268.
2015-04-13 22:44:14 +02:00
Jonas Borgström
7198929bae cache: Warn user before accessing relocated repositories
This also closes #225
2015-04-13 22:42:32 +02:00
Cam Hutchison
9f99aa1abf archive: Fix parsing with missing microseconds.
Archive timestamps are stored as the output of datetime.isoformat().
This function omits microseconds in the string output if the
microseconds are zero (as documented and explained at
https://bugs.python.org/issue7342).

Parsing of timestamps assumes there are always microseconds present
after a decimal point. This is not always true. Handle this case where
it is not true by explicitly using '0' microseconds when not present.

This commit fixes #282
2015-04-13 18:00:46 +10:00
Cam Hutchison
0295ef8563 archive: Add testcases for microsecond handling.
datetime.isoformat() has different output depending on whether
microseconds are zero or not. Add test cases to ensure we handle both
cases correctly in an archive.
2015-04-13 18:00:46 +10:00
Thomas Waldmann
a6f8d51b37 updated PR #279 - Merge branch 'fadvise' into merge 2015-04-11 17:08:17 +02:00
Thomas Waldmann
57071ce6fd repo writes: call posix_fadvise between fsync and close
less calls to posix_fadvise (which seem to force a write-cache sync-to-disk and
wait for that to complete) - if we call it after we synced anyway, we don't lose time.

also: fixed a bug in the os.fsync call, it needs the fileno.
2015-04-11 17:04:10 +02:00
Thomas Waldmann
3653acd259 PR #279 - Merge branch 'fadvise' into merge 2015-04-11 02:51:33 +02:00
Thomas Waldmann
874f5c491b use posix_fadvise for repo writes also 2015-04-11 02:40:22 +02:00
Thomas Waldmann
c7d232c4ce use posix_fadvise to avoid spoiling the OS cache
note:
 - we call this frequently AFTER re-filling the chunker buffer,
so even big input files have little cache impact.
- there is still some cache impact due to output files caching,
if the repository is on a locally mounted filesystem.
2015-04-11 01:09:03 +02:00
Thomas Waldmann
7ad1093951 let chunker optionally work with os-level file descriptor
this safes some back-and-forth between C and Python code and also some memory
management overhead as we can always reuse the same read_buf instead of letting
Python allocate and free a up to 10MB big buffer for each buffer filling read.

we can't use os-level file descriptors all the time though, as chunkify gets also invoked
on objects like BytesIO that are not backed by a os-level file.

Note: this changeset is also a preparation for O_DIRECT support which can be
 implemented a lot easier on C level.
2015-04-08 18:43:53 +02:00
Thomas Waldmann
233d1f7272 Merge security fix from master. Merge branch 'master' into merge 2015-04-07 18:05:36 +02:00
Jonas Borgström
78f9ad1fab Require approval before accessing previously unknown unencrypted repositories
Closes #271
2015-04-06 23:07:10 +02:00
Thomas Waldmann
4be5f312d7 Merge branch 'fix_atime' into merge 2015-04-05 18:11:16 +02:00
Thomas Waldmann
1bf5e9ee29 Merge PR #265 - fixes bug #268 - Merge branch 'fix_safe_re' of https://github.com/lealanko/attic into merge 2015-04-04 11:05:52 +02:00
Lauri Alanko
89e9528d0b Escape ".." in path regexp properly. 2015-04-03 00:19:33 +03:00
Thomas Waldmann
14d91a25fc show tracebacks in top-level exception handler for easier debugging
sure it is "prettier" without, but a lot of useful information for debugging is lost if the traceback is not shown.

even for KeyboardInterrupt:

it may have some bad reason when one has to use Ctrl-C - if attic was stuck somewhere, we want to know where it was.
2015-04-01 23:12:06 +02:00
Thomas Waldmann
e706d1e2e0 PR #258 - Merge branch 'platform_linux_optimize' into merge 2015-04-01 02:13:26 +02:00
Thomas Waldmann
570b8f8231 linux: remove duplicate os.fsencode calls 2015-04-01 02:11:36 +02:00
Thomas Waldmann
dc58cf9b35 PR #254 - Merge branch 'tests_32bit_platform' into merge 2015-03-26 01:36:43 +01:00