Dates Part II

Last post 02-20-2015, 1:24 PM by Chris. 5 replies.
Sort Posts: Previous Next
  • Dates Part II
    Posted: 02-17-2015, 1:47 PM

    Im new to workflows, so maybe I missed something obvious.

    Anyways, I have a restore I want to run from the latest full backup.  Is there an option for this, or do I need to find the exact calendar date?

    The goal is to use the scheduled full backups and use workflows and/or qoperations to automate the restore.


  • Re: Dates Part II
    Posted: 02-17-2015, 7:25 PM


    Is this for file system agent? are you trying to sync the data to another machine?

  • Re: Dates Part II
    Posted: 02-18-2015, 12:45 PM

    I have multiple VMs that I need to send to a 3rd party.  I am using the following process:

    1. Backup the VMs using VSA
    2. Restore the VMs as .VMDK files to my proxy
    3. Backup the .VMDKs as a file system backup
    4. Restore the .VMDKs to the 3rd party client

    The VSA agent is already scheduled using the normal scheduling process for subclients.  Steps 2..4 I am trying to automate using qoperations or workflow.

    Looking at the original "Dates" thread, it appears I can script to find a specific date.  It would be helpful to just grab the latest full backup for a specific subclient.


  • Re: Dates Part II
    Posted: 02-20-2015, 12:14 PM



    You can create one CommServDbquery type control and execute this sql script which will return you the last full job ID and start and end time of the job for the given subclient and you can perform restore using the xml I pasted below use qlist command


    declare @subclientId nvarchar(256)
    declare @backupSetId nvarchar(256)
    declare @instanceId nvarchar(256)
    declare @clientId nvarchar(256)

    DECLARE @client varchar(512)
    SET @client = 'vCenter client'
    DECLARE @appTypeId varchar(256)
    SET @appTypeId = '106'
    DECLARE @instance varchar(512)
    SET @instance = 'VMware'
    DECLARE @SCName varchar(512)
    SET @SCName = 'subClient'

    set nocount on

    DECLARE @csTimeZone    VARCHAR(256)
    SELECT @csTimeZone = timeZone FROM APP_CommCell WITH (NOLOCK) WHERE id = 2

    SELECT @csTimeZone = TimeZoneStdName FROM SchedTimeZone WITH (NOLOCK)
     WHERE  TimeZoneName = SUBSTRING(@csTimeZone, CHARINDEX(':', @csTimeZone, CHARINDEX(':', @csTimeZone, 0) + 1) + 1, 255)
    -- Get Instance ID

     select distinct @instanceId  =      APP_Application.instance
    from        APP_Application, APP_Client, APP_iDAType, APP_InstanceName
    where       APP_Application.clientId =
                and APP_Application.appTypeId = @appTypeId
                and APP_Application.instance =
                and = @client
                and = @instance

    -- Get Client ID

    select @clientId = id from APP_Client where name like @client

    -- componentid to get subclient id
    Select @subclientId = id from APP_Application where clientId = @clientId AND appTypeId = @appTypeId AND instance = @instanceId AND subclientName = @SCName

    -- GetBackupSet ID
    --select @backupSetId = backupSet from APP_Application where id = @subclientId

    -- select @subclientId, @backupSetId,@instanceId,@clientId
    select T.jobid, dbo.UTCToLocalTime(dbo.getdatetime(J.servStartDate),@csTimeZone) as startDate, dbo.UTCToLocalTime(dbo.getdatetime(J.servEndDate),@csTimeZone) as EndDate
    from (
    select MAX(jobId) as JobId from JMBkpStats where appId = @subclientId and bkpLevel = 1 )T
    join JMBkpStats J
    on T.jobID = J.jobId



    Use this browse request xml

    <databrowse_BrowseRequest opType="Browse">
        <entity applicationId="106" backupsetId="180" clientId="826" drivePoolId="0" instanceId="33" libraryId="0" subclientId="257"/>
        <paths path="\"/>
        <timeRange fromTime="2015-02-19 21:23:36.000" toTime="2015-02-19 21:32:54.000"/>
        <options instantSend="true" liveBrowse="true" skipIndexRestore="false" vsDiskBrowse="true"/>
        <mode mode="4"/>
        <ma clientId="0"/>
        <advOptions copyPrecedence="0">
                    <browseAdvancedConfigFBR fbrMA="phoneapps_FBR"/>
        <queries queryId="0" type="DATA">
                <paging firstNode="0" pageSize="2000" skipNode="0"/>
                <sortParam ascending="true">
                    <sortBy val="38"/>
                    <sortBy val="0"/>


  • Re: Dates Part II
    Posted: 02-20-2015, 12:25 PM

    If you need further help in work flow or commandline let me know.

  • Re: Dates Part II
    Posted: 02-20-2015, 1:24 PM

    I created a stored procedure that takes the client, subclient, and backup type then returns the start/end time of the most current job.  I am then calling the xml and using the start/end times as paramaters.

    Im not returning the jobID like you are, but my process is working fine.

    Thanks for the info.

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