So you’ve gone ahead and started to test out the new Veeam Agent for Linux beta in your environment – finally, a Veeam solution to those physical Linux servers that seem to always hang around in the datacenter! Wait, if you haven’t check my post on it here and sign up for the official beta here. Anways we can schedule our jobs – that’s great, but there is only one problem – we currently don’t have any way of reporting on the success of failure of the jobs.
Now this is only a beta and we don’t know what a full version of this will look like – so I don’t want to go ahead and say that this is something the application is lacking as it could be baked in with a future build – but for now let me show you my workaround – how I scripted the ability to report on success of my jobs.
First up, don’t schedule your backup jobs within the VAL gui – Leave the ‘Run the job automatically’ unchecked while you are setting up your job as we have below. Instead, we will write a script that will first kick off the job for us, then store the session id variable so we can later send an email on its success. We will create our own cron entry to handle this rather than using Veeam’s scheduler.
So how do we go about creating this script? Well, before getting to far into it I suggest you head over to Dmitry Kniazev’s blog and read his post on the Veeam Agent for Linux (Serious Mode) as it does a good job at explaining some of the cli commands such as veeamconfig that come with VAL.
As always let me post the full script first, then break it down line by line for you…. Before getting to far in though there are a few quirks! First off, you can see I dump some information and create some files – all of this is done in the /home/ubuntu/ directory – feel free to change this to whatever you like – I didn’t take the time to variabalize all of this – sorry! Secondly, the script uses sendmail – so be sure you have setup properly as well!!!! Anyways, the script
#start the veeam job
sudo veeamconfig job start --name $MYJOBNAME > /home/ubuntu/sessionid
#get sessionid from return text
SESSID=$( grep -r "Session ID" /home/ubuntu/sessionid | cut -d " " -f3 )