bundles/backup-server: ignore all non-digit snapshots when rotating
This commit is contained in:
parent
a7a59fd690
commit
83730ccb6d
1 changed files with 2 additions and 3 deletions
|
@ -33,12 +33,11 @@ for line in check_output('LC_ALL=C zfs list -H -t snapshot -o name', shell=True)
|
|||
|
||||
if line.startswith('{}/{}@'.format(server_settings['zfs-base'], NODE)):
|
||||
_, snapname = line.split('@', 1)
|
||||
ts, bucket = snapname.split('-', 1)
|
||||
|
||||
if 'zfs-auto-snap' in snapname:
|
||||
# migration from auto-snapshots, ignore
|
||||
if not ts.isdigit():
|
||||
continue
|
||||
|
||||
ts, bucket = snapname.split('-', 1)
|
||||
buckets.setdefault(bucket, set()).add(int(ts))
|
||||
syslog(f'classified {line} as {bucket} from {ts}')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue