Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
5588780887
|
|||
b0758a6b8b
|
|||
1290623456
|
|||
2a91a41ede
|
|||
46eed410f0
|
@ -259,7 +259,7 @@ def weed_snapshots(fslist, snapshots, config, failed_snapshots):
|
|||||||
continue
|
continue
|
||||||
if source_fs not in snapshots:
|
if source_fs not in snapshots:
|
||||||
continue
|
continue
|
||||||
if not conf['weed_enable']:
|
if not conf['weed_enable'] or conf['weed_enable'].lower() in ('false', 'no'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
kwargs = {k: int(v) for k, v in conf.items() if k in [
|
kwargs = {k: int(v) for k, v in conf.items() if k in [
|
||||||
@ -369,9 +369,9 @@ def main():
|
|||||||
try:
|
try:
|
||||||
if remote in remote_snapshots:
|
if remote in remote_snapshots:
|
||||||
remote_snapshots[remote] = zsnaplib.get_snapshots(zfs_cmd)
|
remote_snapshots[remote] = zsnaplib.get_snapshots(zfs_cmd)
|
||||||
except zsnaplib.ZFSSnapshotError:
|
except zsnaplib.ZFSSnapshotError as e:
|
||||||
del remote_snapshots[remote]
|
del remote_snapshots[remote]
|
||||||
log.warning("Could not refresh snapshots on {}".format(remote))
|
log.warning("Could not refresh snapshots on {}: {}".format(remote, e))
|
||||||
snapshots = zsnaplib.get_snapshots(local_zfs_cmd)
|
snapshots = zsnaplib.get_snapshots(local_zfs_cmd)
|
||||||
|
|
||||||
failed_send = send_snapshots(fslist, snapshots, config)
|
failed_send = send_snapshots(fslist, snapshots, config)
|
||||||
|
2
setup.py
2
setup.py
@ -6,7 +6,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils import setup
|
from distutils import setup
|
||||||
|
|
||||||
version = '0.3.3'
|
version = '0.3.4'
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='zsnapper',
|
name='zsnapper',
|
||||||
|
@ -37,7 +37,7 @@ def do_zfs_command(args, zfs_cmd, pipecmd=None):
|
|||||||
# check if we try to create a snapshot that already exists. This can happen
|
# check if we try to create a snapshot that already exists. This can happen
|
||||||
# if the script is run every minute and it takes more time than that to
|
# if the script is run every minute and it takes more time than that to
|
||||||
# create all snapshots
|
# create all snapshots
|
||||||
if ctrl_proc.returncode == 1 and re_match(re_err_ok, err):
|
if ctrl_proc.returncode == 1 and re.match(re_err_ok, err.decode('utf-8')):
|
||||||
pass
|
pass
|
||||||
elif ctrl_proc.returncode != 0:
|
elif ctrl_proc.returncode != 0:
|
||||||
raise ZFSSnapshotError('Failed to execute {}: {}'.format(cmd, err))
|
raise ZFSSnapshotError('Failed to execute {}: {}'.format(cmd, err))
|
||||||
@ -83,7 +83,7 @@ def get_filesystems(zfs_cmd):
|
|||||||
|
|
||||||
for row in out.splitlines():
|
for row in out.splitlines():
|
||||||
row = row.decode('UTF-8')
|
row = row.decode('UTF-8')
|
||||||
ret.add(row.split()[0])
|
ret.add(row.split('\t')[0])
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user