#1 Global Leader in Data Resilience

Log Files Associated With Deleted Jobs or Tenants Are Not Automatically Deleted

KB ID: 4720
Product: Veeam Backup & Replication
Veeam Cloud Connect
Published: 2025-04-09
Last Modified: 2025-04-09
mailbox
Get weekly article updates
By subscribing, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Notice.

Cheers for trusting us with the spot in your mailbox!

Now you’re less likely to miss what’s been brewing in our knowledge base with this weekly digest

error icon

Oops! Something went wrong.

Please, try again later.

Challenge

The diagnostic log files created by Veeam Backup & Replication / Veeam Cloud Connect that are associated with a deleted or disabled job, repository, or tenant are not automatically removed and remain on disk taking up space.

Cause

This is expected behavior as log file management only occurs for files associated with active jobs, components, and tenants.

Solution

Log files bearing the name of a deleted or disabled job, Veeam backup component, or Cloud Connect tenant may be manually removed as needed to free up disk space.

More Information

Users may choose to remove specific files or the entire contents of log folders if they wish. However, customers are advised to consider whether those logs will be needed for future issue investigations.
Veeam Intelligent Diagnostics
When Veeam ONE is configured to monitor a Veeam Backup & Replication deployment, it will analyze the Veeam Backup & Replication logs for the last 48 hours or since the last successful log analysis session.
Alternatively, users may consider removing all log files with a modified date older than some given point in time. For example, the following PowerShell script will purge all files within the default log folder (C:\ProgramData\Veeam\Backup\) older than 180 days.
Log Directory Truncation Script Example
This script is provided as a courtesy and is not directly supported by Veeam Technical Support.
# Define the folder path, file age, and file extensions
$folderPath = "C:\ProgramData\Veeam\Backup"
$fileAge = 180
$fileExtensions = @(".log", ".zip", ".log.gz")

# Exclude the vPower NFS Folder from removal.
$excludedFolder = "C:\ProgramData\Veeam\Backup\IRCache\NfsDatastore"

# Calculate the date threshold from which files will be considered old
$dateThreshold = (Get-Date).AddDays(-$fileAge)

# Identify and remove files based on extension and age.
Get-ChildItem -Path $folderPath -Recurse | Where-Object {
$fileExtensions -contains $_.Extension -and
$_.LastWriteTime -lt $dateThreshold
} | ForEach-Object {
Write-Output "Removing file: $($_.FullName)"
Remove-Item -Path $_.FullName -Force
}

# Remove empty folders.
Get-ChildItem -Path $folderPath -Directory -Recurse | ForEach-Object {
try {
if ($_.FullName -ne $excludedFolder) {
if ((Get-ChildItem -Path $_.FullName -Force).Count -eq 0) {
Write-Output "Removing empty folder: $($_.FullName)"
Remove-Item -Path $_.FullName -Force -Recurse
}
}
} catch {
Write-Output "Error removing folder: $($_.FullName) - $($_.Exception.Message)"
}
}
To submit feedback regarding this article, please click this link: Send Article Feedback
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.

Spelling error in text

Thank you!

Thank you!

Your feedback has been received and will be reviewed.

Oops! Something went wrong.

Please, try again later.

You have selected too large block!

Please try select less.

KB Feedback/Suggestion

This form is only for KB Feedback/Suggestions, if you need help with the software open a support case

By submitting, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Notice.
Verify your email to continue your product download
We've sent a verification code to:
  • Incorrect verification code. Please try again.
An email with a verification code was just sent to
Didn't receive the code? Click to resend in sec
Didn't receive the code? Click to resend
Thank you!

Thank you!

Your feedback has been received and will be reviewed.

error icon

Oops! Something went wrong.

Please, try again later.