Skip to content

Commit

Permalink
add exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
shodanshok committed Jan 5, 2024
1 parent 3e01e36 commit 30d108a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/psnap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
before =
after =
efilter =
exclude =
sep = ,
reflink = 0
stripws = 1
Expand Down
6 changes: 6 additions & 0 deletions psnap
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def backup_host(host):
snapdir = get_snapdir(host)
user = config[host]["user"]
folders = config[host]["folder"].split(sep)
exclude = config[host]["exclude"].split(sep)
stripws = int(config[host]["stripws"])
retry = int(config[host]["retry"])
mode = config[host]["mode"]
Expand All @@ -426,6 +427,11 @@ def backup_host(host):
return True
prepare_snapdir(host)
(options, reflink) = mangle_options(host)
# exclude
for exclusion in exclude:
if stripws:
exclusion = exclusion.strip()
options = options + ["--exclude", exclusion]
# rotate snapshots
# if rsyns is not needed, return now
rotation = rotate(host, reflink)
Expand Down

0 comments on commit 30d108a

Please sign in to comment.