fix #3972: Remove the .notes file when a backup is deleted
When a VM or Container backup was deleted, the .notes file was not removed, therefore, over time the dump folder would get polluted with notes for backups that no longer existed. As backup names contain a timestamp and as the notes cannot be reused because of this, I think it is safe to just delete them just like we do with the .log file. Furthermore, I sourced the deletion of the log and notes file into a new function called "archive_auxiliaries_remove". Additionally, the archive_info object now returns one more field containing the name of the notes file. The test cases have to be adapted to expect this new value as the package will not compile otherwise. Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com> Reviewed-by: Fabian Ebner <f.ebner@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
76c98d2353
commit
c3e2ff806f
@ -456,9 +456,8 @@ __PACKAGE__->register_method ({
|
||||
print "Removed volume '$volid'\n";
|
||||
if ($vtype eq 'backup'
|
||||
&& $path =~ /(.*\/vzdump-\w+-\d+-\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2})[^\/]+$/) {
|
||||
my $logpath = "$1.log";
|
||||
# try to cleanup our backup log file too, if still existing, #318
|
||||
unlink($logpath) if -e $logpath;
|
||||
# Remove log file #318 and notes file #3972 if they still exist
|
||||
PVE::Storage::archive_auxiliaries_remove($path);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user