forked from third-party-mirrors/zfs_autobackup
Reordered return data
This commit is contained in:
parent
9d7734c238
commit
1934f8c8b7
@ -164,12 +164,13 @@ return[filesystem_name]=[ "snashot1", "snapshot2", ... ]
|
|||||||
"""
|
"""
|
||||||
def zfs_get_snapshots(ssh_to, filesystems, backup_name):
|
def zfs_get_snapshots(ssh_to, filesystems, backup_name):
|
||||||
|
|
||||||
|
ret={}
|
||||||
|
|
||||||
if filesystems:
|
if filesystems:
|
||||||
snapshots=run(ssh_to=ssh_to, input="\0".join(filesystems), valid_exitcodes=[ 0,1 ], cmd=
|
snapshots=run(ssh_to=ssh_to, input="\0".join(filesystems), valid_exitcodes=[ 0,1 ], cmd=
|
||||||
[ "xargs", "-0", "-n", "1", "zfs", "list", "-d", "1", "-r", "-t" ,"snapshot", "-H", "-o", "name" ]
|
[ "xargs", "-0", "-n", "1", "zfs", "list", "-d", "1", "-r", "-t" ,"snapshot", "-H", "-o", "name" ]
|
||||||
)
|
)
|
||||||
|
|
||||||
ret={}
|
|
||||||
for snapshot in snapshots:
|
for snapshot in snapshots:
|
||||||
(filesystem, snapshot_name)=snapshot.split("@")
|
(filesystem, snapshot_name)=snapshot.split("@")
|
||||||
if re.match("^"+backup_name+"-[0-9]*$", snapshot_name):
|
if re.match("^"+backup_name+"-[0-9]*$", snapshot_name):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user