UPDATED 4/10/12
A few weeks after upgrading Veeam Backup and Recovery 6.0 to build 181 (6.0.0.181) I encountered an issue where all jobs disappeared from the console and did not run as scheduled, as though they’d been deleted. I contacted Veeam support and was told that this was a known issue that could occur “under certain circumstances.” Fortunately the fix is an easy one:
1. Ensure the Veeam PowerShell Snapin is installed.
2. Copy the text between the asterisks below and save as FixJobs.ps1 on your Veeam server.
3. Execute FixJobs.ps1 via PowerShell on your Veeam server.
******************************
asnp VeeamPSSnapin
[void](Get-VBRJob)
$SQLServer = (Get-ItemProperty “HKLM:SOFTWAREVeeamVeeam Backup and Replication”).SqlServerName + “” + (Get-ItemProperty “HKLM:SOFTWAREVeeamVeeam Backup and Replication”).SqlInstanceName
$SqlDBName = (Get-ItemProperty “HKLM:SOFTWAREVeeamVeeam Backup and Replication”).SqlDatabaseName
$SqlQuery = “SELECT type,name,target_dir FROM dbo.BJobs where type=’3′”
$Types = @{ “Backup” = 0; “Replica” = 1; “Copy” = 2; “DRV” = 3 }
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = “Server = $SQLServer; Database = $SQLDBName; Integrated Security = True”
$SqlConnection.Open()
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
[Void]$SqlAdapter.Fill($DataSet)
foreach($row in $DataSet.Tables[0])
{
if($row.target_dir -eq “NULL”)
{
continue
}
elseif($row.target_dir -eq “” -and $row.type -eq 1)
{
continue
}
elseif(($row.target_dir -ne “” -or $row.target_dir -ne “NULL”) -and $row.type -eq 0)
{
continue
}
if ((Test-Path ([Veeam.Backup.Common.Log]::GetPreferedLogPath( [Veeam.Backup.Common.StringEx]::Substring([Veeam.Backup.Common.FileSystemEx]::FilterInvalidFsChars(“Job.” + $row.name), 50)) + “.Backup.log”)) -eq $true)
{
$LogFile = ([Veeam.Backup.Common.Log]::GetPreferedLogPath( [Veeam.Backup.Common.StringEx]::Substring([Veeam.Backup.Common.FileSystemEx]::FilterInvalidFsChars(“Job.” + $row.name), 50)) + “.Backup.log”)
}
elseif((Test-Path ([Veeam.Backup.Common.Log]::GetPreferedLogPath( [Veeam.Backup.Common.StringEx]::Substring([Veeam.Backup.Common.FileSystemEx]::FilterInvalidFsChars(“Job.” + $row.name), 50)) + “.Replica.log”)) -eq $true)
{
$LogFile = ([Veeam.Backup.Common.Log]::GetPreferedLogPath( [Veeam.Backup.Common.StringEx]::Substring([Veeam.Backup.Common.FileSystemEx]::FilterInvalidFsChars(“Job.” + $row.name), 50)) + “.Replica.log”)
}
[Void](@(Get-Content ($LogFile) | Select-String “Job Type: ‘”)[-1] -match “(Job Type: ‘[a-z]*.)([a-z]*)”)
$JobType = $matches[2]
if ($row.type -eq $Types[$JobType])
{
continue
}
else
{
[Void](@(Get-Content ($LogFile) | Select-String “Job Options: ‘”)[-1] -match “(Job Options: ‘)(.*)”)
$JobOptions = $matches[2].TrimEnd(“‘”)
$UpdateQuery = “UPDATE dbo.BJobs SET type='” + $Types[$JobType] + “‘,options=’$JobOptions’ where name='” + $row.name + “‘”
$UpdateCmd = New-Object System.Data.SqlClient.SqlCommand
$UpdateCmd.Connection = $SqlConnection
$UpdateCmd.CommandText = $UpdateQuery
[Void]$UpdateCmd.ExecuteNonQuery()
}
}
$SqlConnection.Close()
******************************
This immediately restored the missing jobs to the console, and they began running again as scheduled. Per Veeam support, this issue will be addressed in an upcoming release.