mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-05-30 01:19:16 +03:00
Use shlex.split() for --pre-snapshot-cmd and --post-snapshot-cmd
This commit is contained in:
parent
b2bf11382c
commit
ec9459c1d2
@ -1,6 +1,7 @@
|
|||||||
# python 2 compatibility
|
# python 2 compatibility
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import re
|
import re
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -193,7 +194,7 @@ class ZfsNode(ExecuteNode):
|
|||||||
|
|
||||||
if pre_snapshot_cmd:
|
if pre_snapshot_cmd:
|
||||||
self.verbose("Running pre-snapshot-cmd:\n\t{}".format(pre_snapshot_cmd))
|
self.verbose("Running pre-snapshot-cmd:\n\t{}".format(pre_snapshot_cmd))
|
||||||
self.run(cmd=pre_snapshot_cmd.split(" "), readonly=False)
|
self.run(cmd=shlex.split(pre_snapshot_cmd), readonly=False)
|
||||||
|
|
||||||
# create consistent snapshot per pool
|
# create consistent snapshot per pool
|
||||||
for (pool_name, snapshots) in pools.items():
|
for (pool_name, snapshots) in pools.items():
|
||||||
@ -206,7 +207,7 @@ class ZfsNode(ExecuteNode):
|
|||||||
|
|
||||||
if post_snapshot_cmd:
|
if post_snapshot_cmd:
|
||||||
self.verbose("Running post-snapshot-cmd:\n\t{}".format(post_snapshot_cmd))
|
self.verbose("Running post-snapshot-cmd:\n\t{}".format(post_snapshot_cmd))
|
||||||
self.run(cmd=post_snapshot_cmd.split(" "), readonly=False)
|
self.run(cmd=shlex.split(post_snapshot_cmd), readonly=False)
|
||||||
|
|
||||||
def selected_datasets(self, exclude_received, exclude_paths):
|
def selected_datasets(self, exclude_received, exclude_paths):
|
||||||
"""determine filesystems that should be backupped by looking at the special autobackup-property, systemwide
|
"""determine filesystems that should be backupped by looking at the special autobackup-property, systemwide
|
||||||
|
Loading…
x
Reference in New Issue
Block a user