Forum Discussion

MSDI's avatar
MSDI
Level 4
10 years ago

Backup Exec 2015 Post command XML Report

Hi, I am trying to implement a custom "verify job" using a BEMCLI in the "POST COMMAND" config option. I call it using "powershell c:\bat\myscript.ps1" and it gets called so everything works fine. The problem I am having is that I need to be able to parse the xml report that is generated during the job I saw the job ID was set as an environment variable so I read it using sJobID = $env:BE_JOB_ID There is also a second environment variable which is $sXmlFileName = $env:VSR_LOG_FILE_NAME which seems to be the temporary xml report (The name looks like C:\Program Files\Symantec\Backup Exec\Data\VSR_Log_File1.xml" But I can't find the data I need in the reports. It seems the report gets saved AFTER the post command is completed so the file BEX_SERVER06_00025.xml (number gets incremented on each run) is not available... I've been playing with Get-BEJob -id $sJobID | Get-BEJobHistory -FromLastJobRun | Get-BEJobLog Without success... Is there a way to retrieve what files were backuped during the post command phase ? I need to return an error if my custom verify finds something invalid so that the job state is switched to "failed". Any help would be appreciated. Regards
  • Ok thanks, That is what I thought based on experiences.

    I think I'll use your suggestion and recover the JOBID from the post command to create a scheduled job

    The scheduled job will then have access to the xml report and will be able to create a restore job to restore, validate and delete the files.

    Thanks everyone for your help.

     

  • Pre and post commands count as part of the job operation and their success or failure should also be written to the job log - hence creating the job logs is the very last operation performed when a job runs. The post command is therefore run after the end of data processing within the job, but not after the end of all job operations

     

    For you to do what you want, you will need to schedule your script for after the job completely finishes (which means it cannot be schueld as part of the job configuration and you will probably have to use task scheduler or possibly some external utility triggered by, perhaps, something like a job sucessful SNMP alert if you have such a capability.)

     

    Note: There is actually a related problem with the pre commands as they have to start within the job as one of the job operations, which usually means you cannot run tape utility jobs as pre-commands as the main job will already have been allocated access and reserved the tape devices.  resulting in the utility job being queued.

  • How are you going to validate their MD5 when they are within a backup set?
  • I want to loop on the folders/files to get the names of the files that were backuped

    Then, I need to validate their MD5 before deleting content in database. (We don't delete files rom database until we are 100% sure they were written to tape). We use WORM tapes

    So any way to retrieve the list of files that were backuped would be great, I thought I could rely on the xml report, but from what I see, the report doesn't yet exist in the post command section.

    I'm wondering if we could retrieve the list from the SQL database of Backup Exec (if it's possible and if it's a "supported" way). That could be an alternative.

    Thanks