mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-13 17:34:57 +00:00
feat(restic): add optional excludes.txt file mapping in volume directory
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Restic commands
|
||||
"""
|
||||
import logging
|
||||
import os.path
|
||||
from typing import List, Tuple
|
||||
from subprocess import Popen, PIPE
|
||||
from restic_compose_backup import commands, utils
|
||||
@@ -25,6 +26,11 @@ def backup_files(repository: str, source='/volumes', tags=''):
|
||||
"backup",
|
||||
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))
|
||||
return commands.run(restic(repository, args))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user