X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/a9a47cf9a73e9ec2454ec71a25acd64f9f6286f9..50aea11082eaa90bd37593b9c987d38a082f4e1b:/cookbooks/backup/files/default/expire-backups?ds=sidebyside diff --git a/cookbooks/backup/files/default/expire-backups b/cookbooks/backup/files/default/expire-backups index 81834d437..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 { @@ -48,7 +48,7 @@ my $keep = qr/^${prefix}(?:${dates})\./; opendir(DIR, "$dir") || die "Can't open ${dir}: $!"; -my @files = sort(grep($match, readdir(DIR))); +my @files = sort(grep(/$match/, readdir(DIR))); closedir(DIR);