Compare commits

..

No commits in common. "48c2f2f1981cbabf57a82afb9b4a24c09a6de62a" and "407bb33359925673cbc0d84120b7003cf48a3eac" have entirely different histories.

5 changed files with 26 additions and 40 deletions

1
NEWS
View File

@ -1,7 +1,6 @@
1.8.11.dev0 1.8.11.dev0
* #851: Fix lack of file extraction when using "extract --strip-components all" on a path with a * #851: Fix lack of file extraction when using "extract --strip-components all" on a path with a
leading slash. leading slash.
* #854: Fix a traceback when the "data" consistency check is used.
1.8.10 1.8.10
* #656 (beta): Add a "spot" consistency check that compares file counts and contents between your * #656 (beta): Add a "spot" consistency check that compares file counts and contents between your

View File

@ -52,8 +52,8 @@ def make_archive_filter_flags(local_borg_version, config, checks, check_argument
def make_check_flags(checks, archive_filter_flags): def make_check_flags(checks, archive_filter_flags):
''' '''
Given a parsed checks set and a sequence of flags to filter archives, Given a parsed sequence of checks and a sequence of flags to filter archives, transform the
transform the checks into tuple of command-line check flags. checks into tuple of command-line check flags.
For example, given parsed checks of: For example, given parsed checks of:
@ -68,13 +68,13 @@ def make_check_flags(checks, archive_filter_flags):
''' '''
if 'data' in checks: if 'data' in checks:
data_flags = ('--verify-data',) data_flags = ('--verify-data',)
checks.update({'archives'}) checks += ('archives',)
else: else:
data_flags = () data_flags = ()
common_flags = (archive_filter_flags if 'archives' in checks else ()) + data_flags common_flags = (archive_filter_flags if 'archives' in checks else ()) + data_flags
if {'repository', 'archives'}.issubset(checks): if {'repository', 'archives'}.issubset(set(checks)):
return common_flags return common_flags
return ( return (

View File

@ -437,27 +437,19 @@ borgmatic's own configuration file. So include your configuration file in
backups to avoid getting caught without a way to restore a database. backups to avoid getting caught without a way to restore a database.
3. borgmatic does not currently support backing up or restoring multiple 3. borgmatic does not currently support backing up or restoring multiple
databases that share the exact same name on different hosts. databases that share the exact same name on different hosts.
4. Because database hooks implicitly enable the `read_special` option, any 4. Because database hooks implicitly enable the `read_special` configuration,
special files are excluded from backups (named pipes, block devices, any special files are excluded from backups (named pipes, block devices,
character devices, and sockets) to prevent hanging. Try a command like character devices, and sockets) to prevent hanging. Try a command like `find
`find /your/source/path -type b -or -type c -or -type p -or -type s` to /your/source/path -type b -or -type c -or -type p -or -type s` to find such
find such files. Common directories to exclude are `/dev` and `/run`, but files. Common directories to exclude are `/dev` and `/run`, but that may not
that may not be exhaustive. <span class="minilink minilink-addedin">New in be exhaustive. <span class="minilink minilink-addedin">New in version
version 1.7.3</span> When database hooks are enabled, borgmatic 1.7.3</span> When database hooks are enabled, borgmatic automatically excludes
automatically excludes special files (and symlinks to special files) that special files (and symlinks to special files) that may cause Borg to hang, so
may cause Borg to hang, so generally you no longer need to manually exclude generally you no longer need to manually exclude them. There are potential
them. There are potential edge cases though in which applications on your edge cases though in which applications on your system create new special files
system create new special files *after* borgmatic constructs its exclude *after* borgmatic constructs its exclude list, resulting in Borg hangs. If that
list, resulting in Borg hangs. If that occurs, you can resort to the manual occurs, you can resort to the manual excludes described above. And to opt out
excludes described above. And to opt out of the auto-exclude feature of the auto-exclude feature entirely, explicitly set `read_special` to true.
entirely, explicitly set `read_special` to true.
5. Database hooks also implicitly enable the `one_file_system` option, which
means Borg won't cross filesystem boundaries when looking for files to backup.
This is especially important when running borgmatic in a container, as
container volumes are mounted as separate filesystems. One work-around is to
explicitly add each mounted volume you'd like to backup to
`source_directories` instead of relying on Borg to include them implicitly via
a parent directory.
### Manual restoration ### Manual restoration

View File

@ -435,16 +435,11 @@ apprise:
label: gotify label: gotify
- url: mastodons://access_key@hostname/@user - url: mastodons://access_key@hostname/@user
label: mastodon label: mastodon
states:
- start
- finish
- fail
``` ```
With this configuration, borgmatic pings each of the configured Apprise With this configuration, borgmatic pings each of the configured Apprise
services when a backup begins, ends, or errors, but only when any of the services when a backup begins, ends, or errors, but only when any of the
`prune`, `compact`, `create`, or `check` actions are run. (By default, if `prune`, `compact`, `create`, or `check` actions are run.
`states` is not specified, Apprise services are only pinged on error.)
You can optionally customize the contents of the default messages sent to You can optionally customize the contents of the default messages sent to
these services: these services:

View File

@ -223,25 +223,25 @@ def test_make_archive_filter_flags_with_default_checks_and_prefix_includes_match
def test_make_check_flags_with_repository_check_returns_flag(): def test_make_check_flags_with_repository_check_returns_flag():
flags = module.make_check_flags({'repository'}, ()) flags = module.make_check_flags(('repository',), ())
assert flags == ('--repository-only',) assert flags == ('--repository-only',)
def test_make_check_flags_with_archives_check_returns_flag(): def test_make_check_flags_with_archives_check_returns_flag():
flags = module.make_check_flags({'archives'}, ()) flags = module.make_check_flags(('archives',), ())
assert flags == ('--archives-only',) assert flags == ('--archives-only',)
def test_make_check_flags_with_archives_check_and_archive_filter_flags_includes_those_flags(): def test_make_check_flags_with_archives_check_and_archive_filter_flags_includes_those_flags():
flags = module.make_check_flags({'archives'}, ('--match-archives', 'sh:foo-*')) flags = module.make_check_flags(('archives',), ('--match-archives', 'sh:foo-*'))
assert flags == ('--archives-only', '--match-archives', 'sh:foo-*') assert flags == ('--archives-only', '--match-archives', 'sh:foo-*')
def test_make_check_flags_without_archives_check_and_with_archive_filter_flags_includes_those_flags(): def test_make_check_flags_without_archives_check_and_with_archive_filter_flags_includes_those_flags():
flags = module.make_check_flags({'repository'}, ('--match-archives', 'sh:foo-*')) flags = module.make_check_flags(('repository',), ('--match-archives', 'sh:foo-*'))
assert flags == ('--repository-only',) assert flags == ('--repository-only',)
@ -250,7 +250,7 @@ def test_make_check_flags_with_data_check_returns_flag_and_implies_archives():
flexmock(module.feature).should_receive('available').and_return(True) flexmock(module.feature).should_receive('available').and_return(True)
flexmock(module.flags).should_receive('make_match_archives_flags').and_return(()) flexmock(module.flags).should_receive('make_match_archives_flags').and_return(())
flags = module.make_check_flags({'data'}, ()) flags = module.make_check_flags(('data',), ())
assert flags == ( assert flags == (
'--archives-only', '--archives-only',
@ -262,7 +262,7 @@ def test_make_check_flags_with_extract_omits_extract_flag():
flexmock(module.feature).should_receive('available').and_return(True) flexmock(module.feature).should_receive('available').and_return(True)
flexmock(module.flags).should_receive('make_match_archives_flags').and_return(()) flexmock(module.flags).should_receive('make_match_archives_flags').and_return(())
flags = module.make_check_flags({'extract'}, ()) flags = module.make_check_flags(('extract',), ())
assert flags == () assert flags == ()
@ -272,10 +272,10 @@ def test_make_check_flags_with_repository_and_data_checks_does_not_return_reposi
flexmock(module.flags).should_receive('make_match_archives_flags').and_return(()) flexmock(module.flags).should_receive('make_match_archives_flags').and_return(())
flags = module.make_check_flags( flags = module.make_check_flags(
{ (
'repository', 'repository',
'data', 'data',
}, ),
(), (),
) )