Made globing for source_directories the default.
Don’t remove non existing files/directories from the list and let attic/borg handle this.
This commit is contained in:
parent
e4cf193cd7
commit
f669e31305
5 changed files with 8 additions and 10 deletions
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@
|
|||
* Fixed handling of repeated spaces in source_directories which resulted in backup up everything.
|
||||
* Added support for --one-file-system for Borg.
|
||||
* Support borg create --umask.
|
||||
* Added support for file globs in source_directories.
|
||||
|
||||
0.1.7
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ Here's an example config file:
|
|||
```INI
|
||||
[location]
|
||||
# Space-separated list of source directories to backup.
|
||||
source_directories: /home /etc
|
||||
# source_directories_glob: 1
|
||||
# Globs are expanded.
|
||||
source_directories: /home /etc /var/log/syslog*
|
||||
|
||||
# Path to local or remote backup repository.
|
||||
repository: user@backupserver:sourcehostname.attic
|
||||
|
|
|
@ -21,7 +21,6 @@ CONFIG_FORMAT = (
|
|||
'location',
|
||||
(
|
||||
option('source_directories'),
|
||||
option('source_directories_glob', int, required=False),
|
||||
option('repository'),
|
||||
),
|
||||
),
|
||||
|
@ -61,16 +60,15 @@ def initialize(storage_config, command):
|
|||
|
||||
def create_archive(
|
||||
excludes_filename, verbosity, storage_config, source_directories, repository, command,
|
||||
one_file_system=None, source_directories_glob=None
|
||||
one_file_system=None
|
||||
):
|
||||
'''
|
||||
Given an excludes filename (or None), a vebosity flag, a storage config dict, a space-separated
|
||||
list of source directories, a local or remote repository path, and a command to run, create an
|
||||
attic archive.
|
||||
'''
|
||||
sources = tuple(re.split('\s+', source_directories))
|
||||
if source_directories_glob:
|
||||
sources = tuple(chain.from_iterable([glob(x) for x in sources]))
|
||||
sources = re.split('\s+', source_directories)
|
||||
sources = tuple(chain.from_iterable([glob(x) if glob(x) else [x] for x in sources]))
|
||||
exclude_flags = ('--exclude-from', excludes_filename) if excludes_filename else ()
|
||||
compression = storage_config.get('compression', None)
|
||||
compression_flags = ('--compression', compression) if compression else ()
|
||||
|
|
|
@ -189,7 +189,6 @@ def test_create_archive_with_globs():
|
|||
source_directories='setup*',
|
||||
repository='repo',
|
||||
command='attic',
|
||||
source_directories_glob=1,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[location]
|
||||
# Space-separated list of source directories to backup.
|
||||
source_directories: /home /etc
|
||||
# source_directories_glob: 1
|
||||
# Globs are expanded.
|
||||
source_directories: /home /etc /var/log/syslog*
|
||||
|
||||
# For Borg only, you can specify to stay in same file system (do not cross
|
||||
# mount points).
|
||||
|
|
Loading…
Reference in a new issue