mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-14 09:52:21 +00:00
feat(restic): add optional excludes.txt file mapping in volume directory
This commit is contained in:
@@ -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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user