[pve-devel] applied: [PATCH storage v4] Fix #318: Delete vzdump log when deleting a backup

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Apr 10 10:16:55 CEST 2019


On 4/9/19 9:41 AM, Dominic Jäger wrote:
> Vzdump log files were not deleted when a backup was deleted.
> Consequently, the folder continuously filled with .log files.
> Now they get deleted after the backup is removed.
> 
> Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
> ---
> No more error message if .log file was deleted before the backup.
> 
>  PVE/API2/Storage/Content.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm
> index e941cb6..4aa9daf 100644
> --- a/PVE/API2/Storage/Content.pm
> +++ b/PVE/API2/Storage/Content.pm
> @@ -307,6 +307,13 @@ __PACKAGE__->register_method ({
>  	}
>  
>  	PVE::Storage::vdisk_free ($cfg, $volid);
> +	if ($vtype eq 'backup' && $path =~
> +	    /(.*\/vzdump-\w+-\d+-\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2})[^\/]+$/) {
> +	    my $logpath = "$1.log";
> +	    if (-e $logpath) {
> +		unlink($logpath);
> +	    }
> +	}
>  
>  	return undef;
>      }});
> 

applied, with cleanup, thanks!





More information about the pve-devel mailing list