Configure Month End Backups using Veeam Backup & Replication

I was faced with the task of configuring monthly backups with Veeam Backup & Replication.  More specifically, configuring month-end backups to take place on the 1st of every month.  The backups needed to be Active Full, not increments.

If we take a closer look at the advanced options within a Veeam backup job, you’ll notice that we only have the ability to schedule the backup job to perform an Active Full backup on a specific day of the month – such as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday.

active-full-schedule-300x124

The issue with this type of scheduling, is that the 1st of the month doesn’t always land on a Monday, for instance.  I had initially scheduled this job to take place on the 1st Monday of the month.  Upon reviewing the calendar, I soon came to realize that when this job runs, there would be an instance where the 1st Monday of the month could land on the 2nd, or the 7th for instance – thus preventing the backup job from performing an Active Full.  It would have resulted in an incremental.

The customer specifically said a full backup needed to take place on the 1st of the month, regardless of the day of the week.  How did I accomplish this task?  I tried to keep it as simple as possible.

There is a script available which includes error reporting at the Powershell prompt, however Veeam does a great job of informing us that a job failed.  Also, this would have to be accomplished using the Windows Task Scheduler.

The first step was to install the Veeam Powershell snapin.  If this wasn’t installed during the initial Veeam Backup & Replication installation, you’ll need to go back and install this option using the Veeam installer.

After installing the Veeam Powershell snapin, I attempted to load the Veeam snapin to confirm this functionality was working:

PS C:\> Add-PSSnapin VeeamPSSnapIn

This presented me with an error, stating that the snapin could not be loaded.

I was faced with another issue – Powershell 2.0 is installed on this Windows Server 2008 R2 machine, however the Veeam snapin requires Powershell 3.0.  I found that running the following script would prevent me from spending extra time uninstalling Powershell, and re-installing Powershell 3.0.

I opened a Powershell administrative command prompt, and changed to the following directory:

C:\Program Files\Veeam\Backup and Replication\Backup

Following this, I ran this command to invoke the installer for the Veeam PS Toolkit, which resulted in success confirming that commands were now available.

PS C:\> .\Install-VeeamToolkit.ps1

install-toolkit-1024x147
That was a relief – I saved loads of time running that script which initializes and registers the correct DLL’s for Powershell to talk to the Veeam PS API.

Now, to test the snapin and its communication with the Veeam engine.  I ran the following command to confirm the backup job I wanted to run which is called “Monthly Backup – ACCOUNTING”

Get-VBRJob | where{$_.Name -eq “Monthly Backup – ACCOUNTING”}

This resulted in success:

confirm-job-name-1024x94

The next step in the development of this task was to set the advanced options in the backup job – I needed a way to perform an Active Full backup, regardless of the day of the week.  The workaround for this was to set the Active Full backup to take place weekly, every day of the week.  If this was set to the Monthly option, it would have taken an Active Full backup if we happened to land on the first Monday, for instance.  This would have resulted in an incremental taking place.

advanced-settings-alldays-276x300

I also needed to make sure that there wasn’t a schedule configured for the backup job.

Through the magic of Windows Task Scheduler, I was ready to schedule triggering the Powershell script to run the 1st of every month.  I created a .ps1 file named “VeeamMonthEnd-ACCOUNTING.ps1” and placed it in an administrative folder on the C drive.  The contents of this simple script are as follows:

Add-PSSnapin VeeamPSSnapin
Get-VBRJob | where{$_.Name -eq “Monthly Backup – ACCOUNTING”} | Start-VBRJob

Let’s begin by creating the scheduled task in Windows.  A name and description is essential for documentation and management purposes:

create-basic-task-1024x703

Now we need to tell the task that we want this script to run Monthly:

monthly-start-1024x706

I chose to start this task at 6:30pm, on the 1st of every month.  Select all of the months, and enter in the 1st as the date to trigger this task:

1st-allmonths-1024x703

The next step defines the action – I chose to run this from a Powershell prompt, triggering our simple script to start the Veeam backup job.  The full command is:

powershell -file “C:\Administration\Environment\Scripts\VeeamMonthEnd-ACCOUNTING.ps1”

st-ps-command-1024x702

After clicking next, you may notice an alert that you’re adding an argument – just ignore this.

Last but not least, our summary screen.  Time to configure some security options – we want this job to run as an administrative user that has access to the Veeam PS Snapin.  In this case, I ran this as the domain user, DOMAIN\veeam.  We also need this job to run with the highest privileges, whether the user is logged in or not:

st-summary-1024x7631

There we have it – a simple way to trigger a Veeam backup job to run the 1st of every month, regardless of the day of the week.  In combination with the Windows Task Scheduler, Powershell, the Veeam Powershell API, and a little scripting, I was able to provide the customer with Active Full, month end backups.

Feel free to leave any questions you may have below and I will do my best to answer them.

You may also like...

2 Responses

  1. Harun KORKMAZ says:

    Hi,
    How do you set veeam job config?
    Did you selected active full backup in job config?

  2. Joseph Pipitone says:

    Yes, active full backup in the job config set for weekly, every day. Job is not scheduled because the Task Scheduler triggers the job to run.

Leave a Reply

Your email address will not be published. Required fields are marked *