feat(restic): add optional excludes.txt file mapping in volume directory
This commit is contained in:
parent
d3b018c100
commit
b5103b27fc
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
Restic commands
|
Restic commands
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import os.path
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
from restic_compose_backup import commands, utils
|
from restic_compose_backup import commands, utils
|
||||||
|
@ -25,6 +26,11 @@ def backup_files(repository: str, source='/volumes', tags=''):
|
||||||
"backup",
|
"backup",
|
||||||
source
|
source
|
||||||
]
|
]
|
||||||
|
|
||||||
|
excludes_file = os.path.join(source, "excludes.txt")
|
||||||
|
if os.path.isfile(excludes_file):
|
||||||
|
args.extend(['--exclude-file', excludes_file])
|
||||||
|
|
||||||
args.extend(utils.format_tags(tags))
|
args.extend(utils.format_tags(tags))
|
||||||
return commands.run(restic(repository, args))
|
return commands.run(restic(repository, args))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue