Custom script to "wait for backup jobs".

Everything about backing up to tape

Custom script to "wait for backup jobs".

Veeam Logoby ayecee » Thu Feb 02, 2017 6:05 pm

Hello All,

I usually get my answers thru searching, but today I'm struggling to find a solution. Thank you all in advance.

A case (Case# 01982449) was opened and closed some time ago. Support was unable to advise on a script for whatever reason. :o

For some background we are running Veeam B&R 9.0 v. 9.0.0.1715. Disk backup mode is set to reverse incremental. Backups run in the evenings Monday thru Friday. Backup to Tape jobs start Saturday 7AM. The tape job is configured to run Daily at this time: 7AM, On these days: Saturday.

The problem is we have a backup to tape job that is dependent\linked to a backup job (fileserver VM). We capture the latest full from disk backup on Friday and write to tape on Saturday. The issue is if the disk backup on Friday night runs longer than expected and finishes after the scheduled tape backup starts, the tape job shows successful, however nothing is written to tape. Veeam reports there are no new files to backup per job settings, which is expected as the disk backup is still running. In the backup to tape properties under scheduling we have the "wait for backup jobs: If some linked backup jobs are still running, wait for up to: 240 minutes". The disk backup completed within this time range, however the tape job already ran, thus no tapes were written to. What is the intended behavior of this option?

Support advised a custom script would be needed. Does anyone have a script that would run to check that the disk backup (.vbk) is complete and ready before starting the backup to tape job?
ayecee
Novice
 
Posts: 3
Liked: never
Joined: Fri Jun 17, 2016 8:08 pm
Full Name: Andrew C

Re: Custom script to "wait for backup jobs".

Veeam Logoby v.Eremin » Fri Feb 03, 2017 11:01 am

Before we start discussing custom script, can you tell whether you have tried to set the following schedule for a backup to tape job:

- as new backup files appear
- backup window: prohibit all days, but one when full backup is created

Doesn't it answer your requirements?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13701
Liked: 1020 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Custom script to "wait for backup jobs".

Veeam Logoby cby » Fri Feb 03, 2017 1:59 pm

Probably not what you're looking for but the principle is identical.

In the days of pre tape backup facility in Veeam we wrote our own tape backup script (bash on Linux) and had to deal with exactly this issue.

The critical check was last modification time based on the epoch time of the .vbk file using the 'stat' command. Example, 'stat -c %Y $(ls -t backup_01.vbk | sed -n 1,1p)'. The script would loop for a configured period at a given interval (say, 10 times with a 60 sec interval - 10 mins in total). On each iteration the modification time was checked against last modification time, i.e. seconds since epoch time. Where the times were identical for the given period (10 mins) the .vbk file was assumed to have been completed by Veeam and the .vbk file written to tape.

It does of course assume Linux mounting the Veeam backup filesystem, in our case NTFS.

Been working for years with no issues.
cby
Expert
 
Posts: 106
Liked: 6 times
Joined: Tue Feb 24, 2009 5:02 pm

Re: Custom script to "wait for backup jobs".

Veeam Logoby ayecee » Wed Feb 08, 2017 4:16 pm

v.Eremin wrote:Before we start discussing custom script, can you tell whether you have tried to set the following schedule for a backup to tape job:

- as new backup files appear
- backup window: prohibit all days, but one when full backup is created

Doesn't it answer your requirements?

Thanks.


Thanks for the recommendation. Sometimes there is no way to predict how long the last disk backup will take before the tape runs. Because of CBT, after resizing a disk on our file server VM the whole disk has to be read. What is usually backed up in 2 hours take 18 hours in one instance we had.
ayecee
Novice
 
Posts: 3
Liked: never
Joined: Fri Jun 17, 2016 8:08 pm
Full Name: Andrew C

Re: Custom script to "wait for backup jobs".

Veeam Logoby v.Eremin » Wed Feb 08, 2017 7:46 pm

In the backup to tape properties under scheduling we have the "wait for backup jobs: If some linked backup jobs are still running, wait for up to: 240 minutes". The disk backup completed within this time range, however the tape job already ran, thus no tapes were written to. What is the intended behavior of this option?

Hmm, the interval should work fine, unless you schedule the backup to tape job to run after a backup job or if you schedule the backup to tape job to start when new backups appear. Chances are, it does not work as expected due to tape job slipping to the next day, but it needs to be confirmed with support team. Therefore, I advice you to open a ticket regarding tape waiting interval.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13701
Liked: 1020 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to Tape



Who is online

Users browsing this forum: No registered users and 3 guests