Previous Topic: Review the Automation PrerequisitesNext Topic: Manage Pre/Post Scripts for Automation


Understanding the Scripting Utilities

Arcserve UDP Agent (Linux) provides scripting utilities to help you create your automation script. These utilities are merely for scripting so their output is scripting friendly. The utilities are used to manage nodes, jobs, replicate backup destinations, and manage activity logs.

All the utilities are contained in the bin folder at the following location:

/opt/CA/d2dserver/bin

The d2dutil --encrypt utility encrypts the password and provides an encrypted password. You must use this utility to encrypt all your passwords. If you use the --pwdfile=pwdfilepath parameter, then you must encrypt the password. You can use the utility one of the following methods:

Method 1

echo "string" | d2dutil --encrypt

string is the password that you specify.

Method 2

Type the "d2dutil –encrypt" command and then specify your password. Press Enter and you will see the result on your screen. In this method, the password that you enter is not echoed on the screen.

Follow these steps:

  1. Log into the Backup Server as a root user.
  2. Navigate to the bin folder using the following command:
    # cd/opt/CA/d2dserver/bin
    
  3. Run the following commands to manage nodes:
    # ./d2dnode
    

    Displays a list of available commands to help you manage all related Linux nodes. Using this command, you can add, delete, modify and import nodes. You can also add nodes using the non-root credentials.

    Note: You can use all the parameters of the d2dnode command, when the Backup Server is a standalone Linux agent. When the Backup Server is managed by UDP Console, the d2dnode command lets you perform only the list, add, modify, and import parameters. The list, add, modify, or import parameters will update the node on the UDP Console. For example, the ./d2dnode --list command will list all the Linux nodes that are added to the UDP Console.

    # ./d2dnode --listLists all the nodes that are managed by the Backup Server.
    
    # ./d2dnode --add=nodename/ip --user=username --password=password --description=”the description of that node” --attach=jobname --force
    

    Adds the specific node to the Backup Server. If you are a root user, use this command to add nodes.

    Note: If you change the port number of the node, then you must specify the new port number in the --add parameter as shown in the following example.

    Example: # ./d2dnode -–add=nodename/ip:new_port -–user=username -–password=password -–description=”the description of that node” --attach=jobname --force

    --attach=jobname

    Adds a new node to an existing backup job.

    --force

    Adds the node forcefully even if the node is managed by another Backup Server. If you remove the force parameter, then the node is not added to this server if it is managed by another Backup Server.

    # ./d2dnode --add=nodename --user=username --password=password --rootuser=rootaccount --rootpwd=rootpassword --pwdfile=pwdfilepath --description=description --attach=jobname -force
    

    Adds the specific node to the Backup Server. If you are a non-root user, use this command to add nodes.

    Note: If you change the port number of the node, then you must specify the new port number in the --add parameter as shown in the following example.

    Example: # ./d2dnode --add=nodename/ip:new_port --user=username --password=password --rootuser=rootaccount --rootpwd=rootpassword --pwdfile=pwdfilepath --description=description --attach=jobname –force

    --user=username

    Specifies the username of the non-root user.

    --password=password

    Specifies the password of the non-rot user. If the --pwdfile=pwdfilepath parameter is provided, then you do not have to specify this parameter.

    --rootuser=rootaccount

    Specifies the username of the root user.

    --rootpwd=rootpassword

    Specifies the password of the root user. If the --pwdfile=pwdfilepath parameter is provided, then you do not have to specify this parameter.

    --pwdfile=pwdfilepath

    (Optional) Specifies the password of the root user and non-root user. This is an optional parameter that you use if you have stored the passwords of the root user and non-root users in a separate file. The password file includes the following parameters: --password=password and --rootpwd=rootpassword. For added security, the password must be encrypted using the d2dutil –encrypt utility. After you encrypt the password, replace the old password with the encrypted password in the --pwdfile parameter.

    # ./d2dnode --node=nodename --attach=jobname
    

    Adds the specified node to an existing backup job.

    # ./d2dnode --modify=nodename/ip --user=username --password=newpassword --description=newdescription
    

    Modifies the username, password, or the description of the added node. If you are a root user, use this command to modify nodes.

    # ./d2dnode --modify=nodename --user=username --password=newpassword --rootuser=rootaccount --rootpwd=newrootpassword --pwdfile=pwdfilepath --description=newdescription
    

    Modifies the username, password, or the description of the added node. If you are a non-root user, use this command to modify nodes.

    --user=username

    Specifies the username of the non-root user.

    --password=newpassword

    Specifies the new password of the non-rot user.

    --rootuser=rootaccount

    Specifies the username of the root user.

    --rootpwd=newrootpassword

    Specifies the new password of the root user.

    --pwdfile=pwdfilepath

    (Optional) Specifies the password of the root user and non-root user. This is an optional parameter that you use if you have stored the passwords of the root user and non-root users in a separate file. The password file includes the following parameters: --password=newpassword and --rootpwd=newrootpassword.

    # ./d2dnode --delete=nodename1,nodename2,nodename3
    

    Deletes the specified nodes from the Backup Server. To delete multiple nodes, use a comma (,) as a delimiter.

    # ./d2dnode --import=network --help
    

    Imports nodes from the network. When you import nodes, you get the following options to configure:

    --netlist

    Specifies the IP v4 IP address list. For multiple entries, the list should be a comma separated entries.

    Example

    192.168.1.100 : Imports the node that has the IP address 192.168.1.100

    192.168.1.100-150 : Import all the nodes that belong to the scope (range) between 192.168.1.100 and 192.168.100.150

    192.168.1.100- : Imports all the nodes that belong to the scope (range) between 192.168.1.100 and 192.168.1.254. Here you not have to mention the end range.

    192.168.1.100-150,192.168.100.200-250 : Imports multiple nodes that belong to two different scopes. The first scope (range) between 192.168.1.100 and 192.168.1.150, and the second scope between 192.168.100.200 and 192.168.100.250. Each entry is separated by a comma.

    --joblist

    Specifies the job name list. A job name must not include a comma. After a node is successfully imported, the node is added to the job. For multiple jobs, the list should be a comma separated entries.

    Example: --joblist=jobA,jobB,jobC

    In this example, each job entry is separated by a comma.

    Note: This option is only supported by the Arcserve UDP Agent (Linux) standalone version.

    --user

    Specifies the user name to import and add the nodes.

    --password

    Specfies the password to import and add nodes.

    --rootuser

    Specifies the user name of the root user. If a non-root user is added, then use this parameter to specify the root user credential.

    --rootpwd

    Specifies the password of the root user. If a non-root user is added, then use this parameter to specify the root user credential.

    --pwdfile

    (Optional) Specifies the password of the root user and non-root user. This is an optional parameter that you use if you have stored the passwords of the root user and non-root users in a separate file. The password file includes the following parameters: --password=newpassword and --rootpwd=newrootpassword.

    --prefix

    Specifies the prefix given to a host name. Use this parameter to filter nodes that includes the prefix in the host name.

    --blacklistfile

    Specifies a file that includes a list of node hostname that you do not want to add to the Backup Server. You must provide one node per line in the file.

    --force

    Adds the node forcefully even if the node is managed by another Backup Server. If you remove the force parameter, then the node is not added to this server if it is managed by another Backup Server.

    --verbose

    Displays more information about the node import process. Use this parameter for debugging or automation scripting purpose.

    --help

    Displays the help screen.

    Notes:

  4. Run the following commands to manage jobs:
    # ./d2djob
    

    Displays a list of commands to help you manage jobs. Using this command, you can run, cancel, and delete jobs.

    # ./d2djob --delete=jobname
    

    Deletes the specified job from the Job Status tab.

    # ./d2djob --run=jobname --jobtype=1 --wait
    

    Runs the specified job. The --jobtype parameter is optional. The d2djob command automatically identifies the job type from the job name that you specify. If the command identifies a restore job, the restore job starts. If the command identifies a backup job and you do not provide any value for the --jobtype parameter, then an incremental backup job starts. The Incremental backup is the default job type.

    If you want to specify the job type for a backup job, then the values are 0, 1, and 2, where 0 indicates a Full backup job, 1 indicates an Incremental backup job, and 2 indicates a Verify backup job.

    # ./d2djob --cancel=jobname --wait
    

    Cancels a job that is in progress.

    If you include --wait in the command, the job status is displayed after the job is canceled. If you do not include --wait in the command, the job status is displayed immediately after submitting the cancellation request.

    # ./d2djob --newrestore=restoreJobName --target=macaddress/ipaddress --hostname=hostname --network=dhcp/staticip --staticip=ipaddress --subnet=subnetMask --gateway=gateway --runnow --wait
    

    Runs a restore job for a new target machine based on an existing restore job. This command lets you use the same restore settings as the existing restore job and only the target machine details are different. If you use this command, you do not have to create multiple restore jobs for different target machines.

    You must provide a value for --newrestore, --target, --hostname, and --network.

    If the value for --network is staticip, then you must provide a value for --staticip, --subnet, and --gateway. If the value for --network is dhcp, then you do not have to provide any value for --staticip, --subnet, and --gateway.

    If you include --runnow in the command, the job runs immediately after you submit the job, irrespective of the job schedule.

    If you include the --wait parameter in the command, the status message is displayed after the completion of the job. If you do not include --wait in the command, the status message is displayed immediately after submitting the job.

    # ./d2djob <--export=jobname1,jobname2,jobname3> <--file=filepath>
    

    Exports multiple jobs from the Backup Server to a file. If you want similar backup configurations in multiple Backup Servers, you can export the backup jobs to a file, and then import the file to other Backup Servers.

    Note: If the Linux Backup Server is managed by Arcserve UDP console, the export function is not supported.

    # ./d2djob <--import=filepath>
    

    Imports the file containing the backup job information to a Backup Server. You can also import the file to Arcserve UDP, if the Backup Server is managed by Arcserve UDP.

    If the backup job is imported to a Backup Server, then you can select the job from the following dialog:

    Add nodes to a job

    You can also use the following command line utility to add nodes to this job:

    ./d2dnode -attach=jobname
    
  5. Run the following commands to create or update the recovery points configuration file. Arcserve UDP Agent (Linux) uses the configuration file to manage and display the recovery points in the UI.
    # ./d2drp
    

    Creates or updates the recovery points configuration files based on the recovery points detail. Using this command, you can create or update the configuration files.

    # ./d2drp --build --storagepath=/backupdestination --node=node_name
    

    Verifies all recovery points that belong to node_name and update all the recovery points configuration files. If the recovery point configuration files are not present, this command create the files automatically. The --build parameter creates the configuration files of recovery points.

    # ./d2drp --build --storagepath=/backupdestination --node=node_name --rp=recovery_point
    

    Verifies the specified session name and update all the recovery points configuration files. If the recovery point configuration files are not present, this command create the files automatically. Specify the keyword 'last' for the --rp parameter to get the most recent recovery point.

    # ./d2drp  --show --storagepath=path --node=nodeName --rp=recovery_point --user=username --password=password
    

    Displays system information for the specified recovery point.

    --rp=recovery_point

    Specifies the recovery point that you want to access. Specify the keyword 'last' to get the most recent recovery point.

    --user=username

    Specifies the username to access the storage location or backup destination.

    --password=password

    Specifies the password to access the storage location or backup destination.

    Note: For the --build parameter, d2drp does not support the NFS share or the CIFS share. If you want to use the NFS share or the CIFS share, you must first mount the share to the local host and then use the mount point as the storagepath.

  6. Run the following command to register Backup Server to Arcserve UDP. When you register the Backup Server with Arcserve UDP, you can manage the Backup Server from Arcserve UDP. You can also import nodes and jobs that were previously managed by Backup Server to Arcserve UDP.
    # ./d2dreg <--reg=servername> <--user=username> <--port=port> <--protocol=http/https> [--password=password]
    

    Registers the Backup Server to Arcserve UDP so that the Backup Server can be managed from Arcserve UDP Console.

    Note: The d2dreg command uses the host name of the Backup Server to identify the server. If Arcserve UDP Console cannot connect to the Backup Server using the host name, then change the host name to IP Address in the Update Node dialog.

  7. Run the following commands to manage activity logs:
    # ./d2dlog
    

    Displays the format that helps you get the activity logs for the specified job id in the specified format.

    # ./d2dlog --show=jobid --format=text/html
    

    Displays the activity log of the specified job. The format value is optional because the default value is text.

  8. Run the following commands to manage the job history:
    # ./d2djobhistory
    

    Displays the job history based on the filters you specify. You can filter the job history by days, weeks, months, and start and end date.

    # ./d2djobhistory --day=n --headers=column_name1,column_name2,...column_name_n --width=width_value --format=column/csv/html
    

    Displays the recent job history based on the specified days.

    --headers=column_name1,column_name2,...column_name_n

    (Optional) Specifies the columns that you want to view in the job history. This is an optional parameter. The predefined columns are ServerName, TargetName, JobName, JobID, JobType, DestinationLocation, EncryptionAlgoName, CompressLevel, ExecuteTime, FinishTime, Throughput, WriteThroughput, WriteData, ProcessedData, and Status.

    --width=width_value

    (Optional) Specifies the number of characters that you want to display for each column. This is an optional parameter. Each column has its own default width. You can update the width value for each column, where each width value is separated by a comma (,).

    --format=column/csv/html

    Specifies the display format of the job history. The available formats are column, csv, and html. You can specify only one format at a time.

    # ./d2djobhistory --week=n --headers=column_name1,column_name2,...column_name_n --width=width_value --format=column/csv/html
    

    Displays the recent job history based on the specified weeks.

    # ./d2djobhistory --month=n --headers=column_name1,column_name2,...column_name_n --width=width_value --format=column/csv/html
    

    Displays the recent job history based on the specified months.

    # ./d2djobhistory --starttime=yyyymmdd --endtime=yyyymmdd --headers=column_name1,column_name2,...column_name_n --width=width_value --format=column/csv/html
    

    Displays the recent job history based on the specified start and end date.

The scripting utilities have been used to successfully manage nodes, jobs, and activity logs.