X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/d62008814effff58445617b19ff7367742d64d34..50aea11082eaa90bd37593b9c987d38a082f4e1b:/cookbooks/backup/files/default/expire-backups diff --git a/cookbooks/backup/files/default/expire-backups b/cookbooks/backup/files/default/expire-backups index 9d82c384a..f05026193 100644 --- a/cookbooks/backup/files/default/expire-backups +++ b/cookbooks/backup/files/default/expire-backups @@ -20,7 +20,7 @@ my @dates; if ($prefix) { - $prefix = "${prefix}-"; + $prefix = "\Q${prefix}-\E"; } else { @@ -43,8 +43,8 @@ for my $month (0 .. $months - 1) } my $dates = join("|", @dates); -my $match = qr/^\Q${prefix}\E\d{4}-\d{2}-\d{2}\./; -my $keep = qr/^\Q${prefix}\E(?:${dates})\./; +my $match = qr/^${prefix}\d{4}-\d{2}-\d{2}\./; +my $keep = qr/^${prefix}(?:${dates})\./; opendir(DIR, "$dir") || die "Can't open ${dir}: $!";