diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-19 15:58:13 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-19 15:58:13 +0100 |
commit | 51183dff448079b64001479b13f1cb386e520e3a (patch) | |
tree | e39e4c487b7f0d6d98885890c90eef5d223dc735 /modules/zfssnap/zfssnap.py | |
parent | 0dd7af80bbcae214daca69d89b5ec046f0fefc07 (diff) | |
download | nixos-51183dff448079b64001479b13f1cb386e520e3a.tar nixos-51183dff448079b64001479b13f1cb386e520e3a.tar.gz nixos-51183dff448079b64001479b13f1cb386e520e3a.tar.bz2 nixos-51183dff448079b64001479b13f1cb386e520e3a.tar.xz nixos-51183dff448079b64001479b13f1cb386e520e3a.zip |
zfssnap: ...
Diffstat (limited to 'modules/zfssnap/zfssnap.py')
-rw-r--r-- | modules/zfssnap/zfssnap.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/zfssnap/zfssnap.py b/modules/zfssnap/zfssnap.py index 76a7727c..6daf11ff 100644 --- a/modules/zfssnap/zfssnap.py +++ b/modules/zfssnap/zfssnap.py | |||
@@ -229,10 +229,14 @@ def autosnap(): | |||
229 | _log_cmd(*args) | 229 | _log_cmd(*args) |
230 | subprocess.run(args, check=True) | 230 | subprocess.run(args, check=True) |
231 | 231 | ||
232 | do_snapshot(*single) | 232 | if single: |
233 | do_snapshot(*recursive, recursive=True) | 233 | do_snapshot(*single) |
234 | if recursive: | ||
235 | do_snapshot(*recursive, recursive=True) | ||
234 | for snap in all_snap_names: | 236 | for snap in all_snap_names: |
235 | logger.info(f'Created ‘{snap}’') | 237 | logger.info(f'Created ‘{snap}’') |
238 | else: | ||
239 | logger.warn('No snapshots to create') | ||
236 | rename(snapshots=all_snap_names) | 240 | rename(snapshots=all_snap_names) |
237 | 241 | ||
238 | def main(): | 242 | def main(): |