Fix restic-batch script

This commit is contained in:
Wojciech Kozlowski 2022-12-19 14:44:36 +01:00
parent 69c5bd067e
commit f454d1d421

View File

@ -122,11 +122,10 @@ if __name__ == "__main__":
cwd=backup_path, env=environ, check=True) cwd=backup_path, env=environ, check=True)
subprocess.run( subprocess.run(
restic_cmd_base + ["forget", "--prune", restic_cmd_base + ["forget", "--prune",
"--keep-daily", config["restic_keep_daily"], "--keep-daily", str(config["restic_keep_daily"]),
"--keep-monthly", config["restic_keep_monthly"]], "--keep-monthly", str(config["restic_keep_monthly"])],
env=environ, check=True, env=environ, check=True,
) )
subprocess.run(restic_cmd_base + ["check"], env=environ, check=True) subprocess.run(restic_cmd_base + ["check"], env=environ, check=True)
finally: finally:
subprocess.run(["/usr/sbin/zfs", "destroy", "rpool/restic"], check=True) subprocess.run(["/usr/sbin/zfs", "destroy", "rpool/restic"], check=True)