Commit graph

465 commits

Author SHA1 Message Date
Michael Hanselmann
d668901df4 Fix typo in comment 2016-01-07 11:18:03 +01:00
TW
48e9b9cb15 Merge pull request #524 from ThomasWaldmann/libc-loader-fallback
add some error handling/fallback for C library loading, fixes #494
2016-01-06 14:43:17 +01:00
Thomas Waldmann
4ed71e2cf5 add some error handling/fallback for C library loading, fixes #494 2015-12-27 14:10:41 +01:00
Thomas Waldmann
c9afa2b27b output progress indication from inner loop, fixes #500
- so it shows progress while it backups a bigger file
- so it announces the filename earlier

also: move rate limiting code to show_progress()
2015-12-27 11:06:03 +01:00
Thomas Waldmann
57b913bc88 fix badly named environment variable, fixes #503
added: BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for the check in "borg delete"
2015-12-20 02:03:33 +01:00
Thomas Waldmann
95f6cd4a4e Merge branch 'master' of github.com:borgbackup/borg 2015-12-13 14:26:49 +01:00
Thomas Waldmann
0c166898bf fix python 3.2 str.splitlines() compatibility issue 2015-12-13 00:51:39 +01:00
Thomas Waldmann
aa97724c0c add --prefix to check to check only some specific archives, fixes #206 2015-12-13 00:39:52 +01:00
Thomas Waldmann
942120997e log remote exceptions, add remote sysinfo 2015-12-12 22:45:29 +01:00
Thomas Waldmann
2df0bb1f83 remote stderr: keep line endings as is
so even the \r trick works for overwriting the same line.
2015-12-12 22:15:08 +01:00
Thomas Waldmann
2e2e145372 sane remote logging, remote stderr, fixes #461 2015-12-12 22:15:08 +01:00
Thomas Waldmann
229512b6f5 determine log level from the logger, so it works with logging.conf also 2015-12-12 22:15:08 +01:00
Thomas Waldmann
f59db03c60 ProgressIndicator: flush the output file or it won't work correctly via ssh
likely due to buffering, the progress indication was not visible.
2015-12-12 22:15:08 +01:00
Thomas Waldmann
eab60cce99 pass through some global options from client to server
new: logging level options
refactored:
- umask option and remote_path
- cleanly separated ssh command from borg command
2015-12-12 22:15:08 +01:00
Thomas Waldmann
c194f3ca1c give (all) args to open_repository 2015-12-12 22:15:08 +01:00
Thomas Waldmann
9c271afefa unify repo/archive parameter name to "location" 2015-12-12 22:15:08 +01:00
Thomas Waldmann
e3d5898add borg upgrade - use inplace parameter, fixes #466
i checked it: copying the index.* and hints.* files in advance is not needed, open() and close() do not modify them.

also: fix unicode exception with encoded filename
2015-12-11 22:18:18 +01:00
TW
bbeda1f743 Merge pull request #481 from ThomasWaldmann/fix-progress
remove --progress magic, fixes #476
2015-12-10 13:34:02 +01:00
Thomas Waldmann
60babd14c3 borg upgrade - do not overwrite backup_repo/index.*, fixes #466
the code obviously wrote to both index.* files as they were hardlinked.
now we make a normal copy of index (and also hints) to avoid this.
2015-12-10 11:59:13 +01:00
Thomas Waldmann
cd804e72b7 borg upgrade - move some code to convert_repo_index
it was a bit confusing to have repo-related code in a method called "convert_cache".
also fixed a typo "index index".
2015-12-10 11:35:48 +01:00
Thomas Waldmann
7acda553ff borg upgrade - fix locking
because Repository.__init__ normally opens and locks the repo, and the upgrader just
inherited from (borg) Repository, it created a lock file there before the "backup copy"
was made.

No big problem, but a bit unclean.

Fixed it to not lock at the beginning, then make the copy, then lock.
2015-12-10 11:11:06 +01:00
Thomas Waldmann
e9ab11be49 borg upgrade - fix README contents 2015-12-10 10:51:56 +01:00
Thomas Waldmann
34b35761dd remove --progress magic, fixes #476
For 0.29 we worked towards a "silent by default" behaviour, so interactive usage will include -v more frequently in future.

But I noticed that this conflicts with the progress display. This would be no problem if users willingly decide which one
of --verbose or --progress they want to see, but before this fix, the progress display was activated magically when
a tty was detected. So, to counteract this magic, users would need to use --no-progress.

That's backwards imho, so I removed the magic again and users have to give --progress when they want
to see a progress indicator. Or (alternatively) they give --verbose when they want to see the long file list.
2015-12-10 10:28:43 +01:00
Thomas Waldmann
8671be1ef2 Increase FUSE read_size to 1024.
From https://github.com/borgbackup/borg/pull/480 discussion:

Did you try 1024 (linux cache block size) or 4096 (internal sector size of bigger
hdds, also used in msgpack fallback.py as lower bound, see link)?

I've tested different values - 512 and 1024 are slightly better than 4096 in my case.

read_size = 1    ls -laR: 75.57 sec
read_size = 64   ls -laR: 27.81 sec
read_size = 512          ls -laR: 27.40 sec
read_size = 1024         ls -laR: 27.20 sec
read_size = 4096         ls -laR: 30.15 sec
read_size = 0    ls -laR: 442.96 sec (default)

OK, maybe we should go for 1024 then. That happens to be < MTU size, so in case someone works on NFS
(or other network FS) we will have less reads, less network packets, less latency.
2015-12-10 10:09:06 +01:00
TW
c4588e4eb4 Merge pull request #480 from alex3d/patch-1
Optimized fuse inode cache
2015-12-10 10:05:09 +01:00
alex3d
3256f22c74 Optimized fuse inode cache
Single-shot unpacker read buffer decreased from (default) 1Mb to 512b.
"ls -alR" on ~100k files backup mounted with fuse went from ~7min to 30 seconds.
2015-12-09 00:34:25 +03:00
Thomas Waldmann
499b6f7313 add a test that invokes borg prune --save-space 2015-12-08 18:36:41 +01:00
Thomas Waldmann
0c076ad114 compact_segments: save_space -> free unused segments quickly
as soon as one target segment is full, it is a good time to commit it and remove the source segments
that are already completely unused (because they were transferred int the target segment).

so, for compact_segments(save_space=True), the additional space needed should be about 1 segment size.

note: we can't just do that at the end of one source segment as this might create very small
target segments, which is not wanted.
2015-12-08 18:36:41 +01:00
Thomas Waldmann
b41f6dfbbf Merge branch 'silent' of https://github.com/ThomasWaldmann/borg into ThomasWaldmann-silent 2015-12-08 01:56:44 +01:00
Thomas Waldmann
cb821b119b remove --log-level, add --debug and --info option, update docs
removed --log-level due to overlap with how --verbose works now.

for consistency, added --info as alias to --verbose (as the effect is
setting INFO log level).

also added --debug which sets DEBUG log level.
note: there are no messages emitted at DEBUG level yet.

WARNING is the default (because we want mostly silent behaviour,
except if something serious happens), so we don't need --warning
as an option.
2015-12-08 01:37:34 +01:00
Thomas Waldmann
68225af449 archive checker: remove report_progress, fix log levels 2015-12-08 00:59:41 +01:00
TW
d05b9b8ac9 Merge pull request #473 from ThomasWaldmann/hashindex-add
hashindex_add C implementation
2015-12-07 22:32:55 +01:00
Thomas Waldmann
720fc49498 hashindex_add C implementation
this was also the loop contents of hashindex_merge, but we also need it callable from Cython/Python code.

this saves some cycles, esp. if the key is already present in the index.
2015-12-07 19:13:58 +01:00
Jakob Schnitzer
3ca1d33d5c fix format of umask in help pages
fixes #463
2015-12-07 18:42:50 +01:00
Jakob Schnitzer
17952dff48 helpers: remove functions that are only used once
The read_msgpack and write_msgpack functions were only used in one place
each.  Since msgpack is read and written in lots of places, having
functions with these generic names is confusing. Also, the helpers
module is quite a mess, so reducing its size seems to be a good idea.
2015-12-07 14:29:01 +01:00
Thomas Waldmann
6d083c0695 increase rpc protocol version to 2
this is needed because due to the locking improvements, some rpc calls' signature changed slightly.
2015-12-03 17:50:37 +01:00
TW
f5634092a2 Merge pull request #455 from ThomasWaldmann/add-progress-indication
Add progress indication, fixes #394
2015-12-03 15:04:44 +01:00
Thomas Waldmann
df24ce5acd progress indicators: add tests 2015-12-03 14:45:16 +01:00
Thomas Waldmann
887196b00e progress indicators: better docstring, minor code improvement 2015-12-03 14:14:28 +01:00
TW
9005586ca4 Merge pull request #452 from ThomasWaldmann/hashtable
misc. hash table tuning
2015-12-02 16:45:39 +01:00
Stavros Korokithakis
d572ceaca2 Display proper repo URL. 2015-12-02 16:51:49 +02:00
Thomas Waldmann
21bd01ef16 add a --filter option replacing --changed/--unchanged
the problem here was that we do not just have changed and unchanged items,
but also a lot of items besides regular files which we just back up "as is" without
determining whether they are changed or not. thus, we can't support changed/unchanged
in a way users would expect them to work.

the A/M/U status only applies to the data content of regular files (compared to the index).
for all items, we ALWAYS save the metadata, there is no changed / not changed detection there.

thus, I replaced this with a --filter option where you can just specify which
status chars you want to see listed in the output.

E.g. --filter AM will only show regular files with A(dded) or M(odified) state, but nothing else.
Not giving --filter defaults to showing all items no matter what status they have.

Output is emitted via logger at info level, so it won't show up except if the logger is at that level.
2015-12-02 03:29:20 +01:00
Thomas Waldmann
fe6916bd22 refactor upgrade progress indication code to use ProgressIndicatorPercent 2015-12-02 01:26:26 +01:00
Thomas Waldmann
7a1316cb79 implement ProgressIndicators, use it for repo check and segment replay, fixes #195, fixes #188 2015-12-02 01:06:07 +01:00
Thomas Waldmann
610300c1ce misc. hash table tuning
BUCKET_UPPER_LIMIT: 90% load degrades hash table performance severely,
so I lowered that to 75% (which is a usual value - java uses 75%, python uses 66%).
I chose the higher value of both because we also should not consume too much
memory, considering the RAM usage already is rather high.

MIN_BUCKETS: I can't explain why, but benchmarks showed that choosing 2^N as
table size severely degrades performance (by 3 orders of magnitude!). So a prime
start value improves this a lot, even if we later still use the grow-by-2x algorithm.

hashindex_resize: removed the hashindex_get() call as we already know that the values
come at key + key_size address.

hashindex_init: do not calloc X*Y elements of size 1, but rather X elements of size Y.
Makes the code simpler, not sure if it affects performance.

The tests needed fixing as the resulting hashtable blob is now of course different due
to the above changes, so its sha hash changed.
2015-12-01 21:18:58 +01:00
Antoine Beaupré
b09643e14f change file status test and cleanup last ref to --verbose
this ports the changes here to #445
2015-11-24 12:11:43 -05:00
Antoine Beaupré
1785ca54ba do not display unchanged files by default
add a --unchanged topical file to display those files
2015-11-24 12:07:57 -05:00
Antoine Beaupré
fce5aed5bb move changed with other topical flags
we need to have a sane default there otherwise the option may not be defined in some sub-commands and will crash
2015-11-24 12:07:57 -05:00
Antoine Beaupré
8d3d1c22d6 silence borg by default
this also prints file status on stderr directly, bypassing the logger
as we do with other topical flags (like progress and status)
2015-11-24 12:07:56 -05:00
Antoine Beaupré
9899eaf241 silence file listing unless --changed is present 2015-11-24 12:07:56 -05:00