diff --git a/proxmox-autosnap.py b/proxmox-autosnap.py index f67dd7e..96f1d4f 100644 --- a/proxmox-autosnap.py +++ b/proxmox-autosnap.py @@ -97,7 +97,7 @@ def remove_snapshot(vmid: str, virtualization: str, label: str = 'daily', keep: snapshots = run_command([virtualization, 'listsnapshot', vmid]) for snapshot in snapshots['message'].splitlines(): - snapshot = re.search(r'auto{0}(\d+|_\d{{4}}_\d{{2}}_\d{{2}}T\d{{2}}_\d{{2}}_\d{{2}})'.format(label), snapshot.replace('`->', '').split()[0]) + snapshot = re.search(r'auto{0}([_0-9T]+$)'.format(label), snapshot.replace('`->', '').split()[0]) if snapshot is not None: listsnapshot.append(snapshot.group(0))