SHTRUKUM Trusted Contributor.
Trusted Contributor.
625 views

Want the command line to create the spec in DP

Hi Team,

i want to automate the DP to create the Spec, please hlep with the command line. I went though the doc, but no where find the command used to create the Spec. and also schedule the spec.

 

Regards

Shtrudhan

 

0 Likes
5 Replies
JJJ Honored Contributor.
Honored Contributor.

Re: Want the command line to create the spec in DP

I clarify, you want to start new backup specification using CLI and Schedule this?

If so you should use the OMNIB cli command, the Command reference guide shows some examples there,

Depending on your Cell Manager OS, you can schedule this is many ways, Maybe some more info on your environment might be useful.

0 Likes
SHTRUKUM Trusted Contributor.
Trusted Contributor.

Re: Want the command line to create the spec in DP

Thank you.

what are formate to used this command.

0 Likes
Honored Contributor.. Gamut Honored Contributor..
Honored Contributor..

Re: Want the command line to create the spec in DP

omnib is for starting a backup, not for creating one.

omniwl.pl is for changing backup specifications (only file backups I guess).

AFAIK, there is no command for creating one. As such, we wrote our own scripting for creating backups. Just look at the structure of the backup specification you already have: it IS structured, and the documentation of omnib explains most if not all options that are in those files. If the omnib documentation fails, try changing 1 option via the GUI and see what changed in the backup specification. We use this approach to add a new VM to DP based on basically only th UUID of the VM.

If you are a Perl addict like me, you'll find the source of omniwl.pl and Omniback.pm helpful. Those files give some clues about the hidden features of util_cmd.exe, like GetDatalist and PutDatalist. Omniback.pm will also do the dirty job of converting the encoded output of util_cmd.exe to a perl hash, and vice versa. We use this stuff to be able to restart only those object that have status "Completed with Errors" (which are not restartable via omnib nor GUI).

 

Schedule files: these are structured as well. Basically the same answers as for creating backup specifications.

0 Likes
SHTRUKUM Trusted Contributor.
Trusted Contributor.

Re: Want the command line to create the spec in DP

Hi Gamut,

Thank you. I will look the suggested Tag. request you to shared the script which u have created. it will save lot of time for me.

0 Likes
Highlighted
Honored Contributor.. Gamut Honored Contributor..
Honored Contributor..

Re: Want the command line to create the spec in DP

#!/bin/bash

if [ $# -ne 8 ]
then
        echo "Usage: ${0} VM_UUID VM_PATH VM_VCENTER VM_DATACENTER BACKUP_NAME BACKUP_GATEWAY BACKUP_MEDIASERVER BACKUP_PROTECTION_DAYS"
        exit 1
fi

VM_UUID="${1}"
VM_PATH="${2}"
VM_VCENTER="${3}"
VM_DATACENTER="${4}"
BACKUP_NAME="${5}"
BACKUP_GATEWAY="${6}"
BACKUP_MEDIASERVER="${7}"
BACKUP_PROTECTION_DAYS="${8}"

BARPATH='/etc/opt/omni/server/barlists/veagent'
SCHEDPATH='/etc/opt/omni/server/barschedules/veagent'



## Write the backup specification.
cat > "${BARPATH}/${BACKUP_NAME}" << __EOT__
BARLIST "${BACKUP_NAME}"
RECONNECT
DYNAMIC 1 1
DEVICE "${BACKUP_GATEWAY}"
{
        -sync
}

CLIENT "${VM_DATACENTER}" ${BACKUP_MEDIASERVER}
{
        -exec vepa_bar.exe
        -args {
                "backup"
                "--virtual-environment"
                "VMWare"
                "--readstdin"
        }
        -input {
                "method=4;preexec='';postexec='';origviewmode=8;appserver='${VM_VCENTER}';mounthost='';free_space_required=0;include=({type=4;path                                  ='${VM_PATH}';uuid='${VM_UUID}';});"
        }
        -public
} -protect days ${BACKUP_PROTECTION_DAYS}
__EOT__



## Write the backup schedule.
cat > "${SCHEDPATH}/${BACKUP_NAME}" << __EOT__
-full -protection -days ${BACKUP_PROTECTION_DAYS}
-every
        -day Fri
        -at 17:00

-incr -protection -days ${BACKUP_PROTECTION_DAYS}
-every
        -day Mon Tue Wed Thu
        -at 17:00
__EOT__



## Start the initial backup.
/opt/omni/bin/omnib -veagent_list "${BACKUP_NAME}" -barmode full -no_monitor -protect days "${BACKUP_PROTECTION_DAYS}"

exit 0

That is the script we use for creating a new VEAgent job. May it prove useful to you as well.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.