PostBackup process for Windows agent

Last post 08-18-2010, 3:25 PM by Bill Baumann. 1 replies.
Sort Posts: Previous Next
  • PostBackup process for Windows agent
    Posted: 08-18-2010, 12:37 PM

    Does anyone know how to read in the return code from the backup of a Windows agent?  We need to put in a PostBackup batch script which will only run upon succesful completion of the data protection job.  By default, the behavior of the appliction will run the PostBackup script even if the job is killed or fails.

    We're a Unix shop, and I see how I can do that with echo $STATUS and redirecting that to a file.  Not sure for Windows.


  • Re: PostBackup process for Windows agent
    Posted: 08-18-2010, 3:25 PM

    You can use the additional argument below in your script to check the status of the job phase before running the script and then act accordingly based on the return code. (note code "4" which is:  The job was killed while executing that phase and "2" which is: The phase failed)

    Whereas i cannot write the script for you if you add these factors correctly you can have it only run if the job completes successfully. So basically it an aded argument to your batch file that can account for the failure or killed job status.

    For Windows, a Pre/Post command that is a batch file needs to be run using the command interpreter cmd.exe /C.

    Example: c:\winnt\system32\cmd.exe /C  ""c:\program files\pre.bat" "test set""

    In addition to the specified Pre/Post commands, the CommServe sends additional arguments and appends them to the Pre/Post commands (if any); this can provide a useful means of control based on the type of job being run. You can use the value of the argument(s) within Pre/Post batch files or scripts to run specific operations based on the level, number of attempts, or status of the job (e.g., for Unix, by issuing an echo command or including a case statement within the appropriate script). These arguments include the following:

    status <n> where "n" is one of the following values indicating the status of the phase that preceded a given Post process within a given job: (This will be passed to all Post processes, but not to Pre processes.)
    '1' =  The phase succeeded
    '2' =  The phase failed
    '3' =  The phase succeeded with one or more errors
    '4' =  The job was killed while executing that phase
    Example: If you want to run a Post process (e.g., PostBackup) only if the preceding phase (e.g., Backup) was a success, you can test the value of the "status" argument received by the Post process and take the appropriate action.
The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Copyright © 2020 Commvault | All Rights Reserved. | Legal | Privacy Policy