Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d889230ed
|
||
|
|
48049f68b6
|
||
|
|
b3a31ada0b
|
||
|
|
328d1649ce
|
||
|
|
5588780887
|
||
|
|
b0758a6b8b
|
+4
-5
@@ -369,14 +369,12 @@ 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)
|
||||||
if failed_send:
|
|
||||||
ret = RET_CODES['ERROR']
|
|
||||||
failed_snapshots.update(failed_send)
|
failed_snapshots.update(failed_send)
|
||||||
for remote in remotes.keys():
|
for remote in remotes.keys():
|
||||||
failed_send = send_snapshots(
|
failed_send = send_snapshots(
|
||||||
@@ -397,6 +395,7 @@ def main():
|
|||||||
failed_snapshots)
|
failed_snapshots)
|
||||||
|
|
||||||
os.remove(lockfile)
|
os.remove(lockfile)
|
||||||
|
return ret
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
log = logging.getLogger(LOGGER)
|
log = logging.getLogger(LOGGER)
|
||||||
@@ -409,7 +408,7 @@ if __name__ == '__main__':
|
|||||||
for logsocket in ('/var/run/log', '/dev/log'):
|
for logsocket in ('/var/run/log', '/dev/log'):
|
||||||
try:
|
try:
|
||||||
mode = os.stat(logsocket).st_mode
|
mode = os.stat(logsocket).st_mode
|
||||||
except FileNotFoundError:
|
except (PermissionError, FileNotFoundError):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if stat.S_ISSOCK(mode):
|
if stat.S_ISSOCK(mode):
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils import setup
|
from distutils import setup
|
||||||
|
|
||||||
version = '0.3.4'
|
version = '0.3.7'
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='zsnapper',
|
name='zsnapper',
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ def get_snapshots(zfs_cmd):
|
|||||||
snapshots = {}
|
snapshots = {}
|
||||||
|
|
||||||
for row in out.splitlines():
|
for row in out.splitlines():
|
||||||
row = row.decode('UTF-8').split()[0]
|
row = row.decode('UTF-8').split('\t')[0]
|
||||||
res = re_snapshot.match(row)
|
res = re_snapshot.match(row)
|
||||||
if res:
|
if res:
|
||||||
d = datetime.datetime.strptime(res.group(2), time_format)
|
d = datetime.datetime.strptime(res.group(2), time_format)
|
||||||
|
|||||||
Reference in New Issue
Block a user