Skip to content

Commit

Permalink
fixed removal of destination snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jollyjinx committed Jan 31, 2014
1 parent 9085f84 commit 32465b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zfstimemachinebackup.perl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

for my $snapshotname (@snapshotsnewerondestination)
{
JNX::ZFS::destroysnapshots( %destination, snapshots => $snapshotname );
JNX::ZFS::destroysnapshots( %destination, dataset => $destinationdataset,snapshots => $snapshotname );

@destinationsnapshots = grep(!/^\Q$snapshotname\E$/,@destinationsnapshots); # grep as delete @destinationsnapshots[$snapshotname] works only on hashes.
}
Expand Down Expand Up @@ -293,12 +293,12 @@
my $snapshottime = JNX::ZFS::timeofsnapshot($snapshotname);
if( $snapshottime < time()-$minimumtimetokeepsnapshotsonsource )
{
JNX::ZFS::destroysnapshots( %source, snapshots => $snapshotname );
JNX::ZFS::destroysnapshots( %source, dataset=>$sourcedataset, snapshots => $snapshotname );
}
}
else
{
JNX::ZFS::destroysnapshots( %source, snapshots => $snapshotname );
JNX::ZFS::destroysnapshots( %source, dataset=>$sourcedataset, snapshots => $snapshotname );
}
}
}
Expand Down Expand Up @@ -340,7 +340,7 @@
{
print 'Will remove snapshot:'.$snapshotname.'='.$snapshottime.' Backup in bucket: $backupbucket{'.$bucket.'}='.$backupbuckets{$bucket}."\n";

JNX::ZFS::destroysnapshots( %destination, snapshots => $snapshotname );
JNX::ZFS::destroysnapshots( %destination, dataset => $destinationdataset, snapshots => $snapshotname );
}
}
else
Expand Down

0 comments on commit 32465b3

Please sign in to comment.