]> git.proxmox.com Git - pve-zsync.git/commitdiff
Fix #1245: Fix snapshot parser.
authorWolfgang Link <w.link@proxmox.com>
Tue, 10 Jan 2017 09:56:52 +0000 (10:56 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 12 Jan 2017 10:47:36 +0000 (11:47 +0100)
Make the snapshot parser more exact.
This avoid that a wrong snap-name will returned
if two or more job names has the same beginning.

pve-zsync

index 194eabf684b061fa1dac19cba0f6f4c155864474..074b99e17982242841c48b4044f628505243b3f4 100644 (file)
--- a/pve-zsync
+++ b/pve-zsync
@@ -636,7 +636,7 @@ sub snapshot_get{
 
     while ($raw && $raw =~ s/^(.*?)(\n|$)//) {
        $line = $1;
-       if ($line =~ m/(rep_$name.*)$/) {
+       if ($line =~ m/(rep_\Q${name}\E_\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})$/) {
 
            $last_snap = $1 if (!$last_snap);
            $old_snap = $1;