Forum Discussion

CarolineKiel's avatar
11 years ago

Export Backup Selection list via BEMCLI

Hi,
Is there a chance, to export a (or all) backup selection lists via PowerShell in BE2012?

If I use "get-bejobs", I only get a summary like "<servername> (Partial), C: (Partial), D: (Partial)"

Thank you very much,
Oliver

  • Hi everyone,
    I found out, that it is possible by simply querying the database directly:

    SELECT t2.[JobName]
    ,t1.[DeviceSelectionName]
    ,t1.[PathName]
    ,t1.[FileName]
    ,t1.[OperType]
    FROM [BEDB].[dbo].[vwScriptPropertiesBackup] t1,[BEDB].[dbo].[vwScriptJob] t2
    WHERE t1.scriptname = t2.scriptname AND t1.ScriptID <> '10011001-1001-1001-0101-010101010101'
    AND t1.ScriptID <> '10011002-1001-1001-0101-010101010101' AND t2.jobname <> 'NULL' AND t1.DeviceSelectionName <> 'NULL'

    The results are filtered to drop the default exclusions that BE does automatically.

    All the best from over here,
    Oliver

4 Replies

  • Hi everyone,
    I found out, that it is possible by simply querying the database directly:

    SELECT t2.[JobName]
    ,t1.[DeviceSelectionName]
    ,t1.[PathName]
    ,t1.[FileName]
    ,t1.[OperType]
    FROM [BEDB].[dbo].[vwScriptPropertiesBackup] t1,[BEDB].[dbo].[vwScriptJob] t2
    WHERE t1.scriptname = t2.scriptname AND t1.ScriptID <> '10011001-1001-1001-0101-010101010101'
    AND t1.ScriptID <> '10011002-1001-1001-0101-010101010101' AND t2.jobname <> 'NULL' AND t1.DeviceSelectionName <> 'NULL'

    The results are filtered to drop the default exclusions that BE does automatically.

    All the best from over here,
    Oliver

  • Unfortunately, no.  I have not found a way to do so.  There is a switch in BEMCMD that does dump selection details, but BEMCLI has no equivalent function.

    You might want to post this as an Idea.

  • Export a single backup definition:

    Get-BEBackupDefinition –name <definition name> |  Export-BEBackupDefinition > c:\<somename>.ps1

    To export all definitions to a separate ps1 file:

     $jobs = Get-BEBackupDefinition
     foreach ($job in $jobs)
     {
                     $defname = $job.name
                     $job | Export-BEBackupDefinition > c:\$defname.ps1
                   
     }

    Import the backup definition:
    <exported-bebackupdefinition.ps1> -AgentServer  <agent server name> | save-BEBackupdefinition