Vous êtes sur la page 1sur 124

Redefining Data Protection

Title Page

command line interface users guide


for version 7.4.x

Version 7.4.x

NVE 7009-40A 12/21-06

Copyrights
Software Copyright 2006 BakBone Software NetVault:Backup - Command Line Interface Users Guide for Version 7.4.x Copyright 2006 BakBone Software Printed and On Line versions. This software product is copyrighted and all rights are reserved. The distribution and sale of this product are intended for the use of the original purchaser only per the terms of the License Agreement. All other product trademarks are the property of their respective owners. The NetVault:Backup - Command Line Interface Users Guide for Version 7.4.x documentation is copyrighted and all rights are reserved. This document may not, in whole or part, be copied, photocopied, reproduced, translated, reduced or transferred to any electronic medium or machine-readable form without prior consent in writing from BakBone Software. THIS PUBLICATION IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW EDITIONS OF THE PUBLICATION. BAKBONE SOFTWARE MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.

BakBone Software
9540 Towne Centre Drive, Suite 100 San Diego, California 92121 866.484.2663

command line interface users guide

Table of Contents
Section 1: The NetVault:Backup CLI
Chapter 1: Introduction to the NetVault:Backup CLI 7

The NetVault:Backup Command Line Interface.............................................................. 9 - Help from the Command Line Interface .................................................................................. 9 - The NetVault:Backup CLI and Access Control ......................................................................... 9 Working with Command Line Executables ................................................................... 10 - Preparing to Run Command Line Executables ...................................................................... 10 - Command Syntax .............................................................................................................. 10 - The nvsetmodify.cfg File ................................................................................................... 13 Technical Support............................................................................................................ 14 - Helpdesk Support Lines ...................................................................................................... 14 - BakBone Softwares Web Site ............................................................................................. 14

Chapter 2: NetVault:Backup CLI Commands

15

Using Command Line Executables................................................................................ 17 - Client Specific Command Line Executables .......................................................................... 17 - Device Specific Command Line Executables ......................................................................... 20 - Media Specific Command Line Executables .......................................................................... 30 - Job Specific Command Line Executables ............................................................................. 38 - NetVault Logs and the Command Line Interface .................................................................... 63 - Other Command Line Executables ....................................................................................... 66

Section 2: Appendix
Appendix A: Running Reports from the CLI 71

NetVault:Backup Reporting with the CLI....................................................................... 73 - Help from the Command Line .............................................................................................. 73 Using nvreport to View Reports from the CLI ........................................................... 73 - Classes (The -class Switch) .............................................................................................. 74

iv

Table of Contents

- Template Files (The -templatename/-templatefile Switches) ................................................83 - Adjusting a Reports Layout and Content ...............................................................................87

The nvreport Command and External Reports ........................................................100 - Creating External Report Files from the CLI .........................................................................100

command line interface users guide

S E C T I O N

The NetVault:Backup CLI

1 :

command line interface users guide

Chapter 1:

Introduction to the NetVault:Backup CLI


1.0.0 - The NetVault:Backup Command Line Interface .................................. 9
1.0.1 - Help from the Command Line Interface ...................................................................... 9 1.0.2 - The NetVault:Backup CLI and Access Control ............................................................ 9

1.1.0 - Working with Command Line Executables ........................................... 10


1.1.1 - Preparing to Run Command Line Executables .......................................................... 10 1.1.2 - Command Syntax ..................................................................................................... 10 - 1.1.2.a - Switch Abbreviation ............................................................................................. 11 - 1.1.2.b - NetVault:Backup Names and the CLI ..................................................................... 11 - 1.1.2.c - Using Spaces in CLI Variables .............................................................................. 12 - 1.1.2.d - NetVault:Backup Environmental Variables and the CLI ............................................ 12 - 1.1.2.e - Command Exit Statuses ....................................................................................... 13 1.1.3 - The nvsetmodify.cfg File ....................................................................................... 13

1.2.0 - Technical Support ............................................................................................. 14


1.2.1 - Helpdesk Support Lines ........................................................................................... 14 1.2.2 - BakBone Softwares Web Site .................................................................................. 14

Chapter 1 Introduction to the NetVault:Backup CLI

NetVault: Backup Command Line Interface Users Gude

1.0.0

The NetVault:Backup Command Line Interface


NetVault:Backup makes available a utility known as the Command Line Interface (CLI). The CLI is designed to allow you to control various functions of NetVault:Backup through the use of predefined executables from a terminal session prompt. These executables, when written in the correct syntax from a prompt, are capable of performing such NetVault:Backup operations as: Starting or Stopping a NetVault:Backup Job Creating and Submitting jobs - This includes creating, editing, and submitting backup and restore jobs for any NetVault:Backup Client controlled by the NetVault:Backup Server. The various selection sets to be used with the jobs can also be created from the command line. Managing Libraries or Other Devices - This includes importing and exporting media, blanking media, getting drive and library status, listing the library (all slots, drives, etc.), marking media for re-use, and others. Generating Custom and Stock Reports - This includes various reports pertaining to Clients, Devices, Media, and NetVault:Backup Jobs. View the Latest Operator Messages - To determine if attention is required.

1.0.1

Help from the Command Line Interface


To access the help notes on commands, input the desired command followed by the switch -help or --help. Simply typing the command (i.e., without using any switches) and hitting the Enter key will also display the help notes. For example, help notes for the nvblankmedia command can be accessed using any of the following methods: nvblankmedia -help nvblankmedia --help nvblankmedia

1.0.2

The NetVault:Backup CLI and Access Control


The Access Control utility allows an administrator to limit the level of access each user has to NetVault:Backup functionality. This accessibility setting also covers the CLI. For example, if an administrator has blocked a specific user from blanking media in the NetVault:Backup GUI, the same user will also be blocked from issuing CLI commands used to blank media as well. As well, it is possible to deny access entirely to CLI functionality. For complete details on allowing or denying access to functions in NetVault:Backup, please see the NetVault: Backup - Administrators Guide.

10

Chapter 1 Introduction to the NetVault:Backup CLI

Important: Even if CLI access has been granted to a specific user account, the proper
account and password values associated with that account must be input before these tools can be used (e.g., via a script from a Command Line session). The environmental variables necessary for inclusion in a script to allow this access consist of the following: NETVAULTCLIACCOUNT - Used to name the Account with access to use the CLI. NETVAULTCLIPASSWORD - Used to name the Password associated with the Account.

1.1.0

Working with Command Line Executables


The sections that follow offer a general description of how NetVault:Backups CLI is used and any pre-requisite steps that should be performed. It is highly recommended that you fully review this section of the guide before attempting to use any of the CLI commands. All NetVault:Backup CLI Scripts are non-blocking. This means that a response to the script command is returned before the action has actually completed. This allows for continuous running of various scripts without NetVault:Backup stopping.

1.1.1

Preparing to Run Command Line Executables


Before running a NetVault:Backup script from the command line, it is first necessary to navigate to the proper directory that contains all NetVault:Backup CLI scripts. From the command line navigate to: ...\NetVault\util

1.1.2

Command Syntax
The syntax of a command takes the following form:
Syntax Command -switch 1 <value> -switch 2 <value> -switch 3 <value> | -switch 4 <value> [-switch 5],

Information enclosed in < > is a user input variable based on the command preceding the brackets (e.g., If a NetVault:Backup Server was named Server1, input servername <server name> as servername Server1). Switches enclosed in [ ] are optional. A | symbol between two switches indicates that only one of the multiple listed can be used in a command.

NetVault: Backup Command Line Interface Users Gude

11

Important:
1. All scripts shown in syntax format are to be input as one line, unless otherwise noted. 2. The order of the switches is not important in the syntax.

1.1.2.a

Switch Abbreviation
Switches can be specified using only initial letter in their name, provided this letter is unique (i.e., no other switch name used by the selected command begins with the same letter). Using the nvbulkblankmedia command as an example, a description of the command is given along with all of its switches:
Syntax nvbulkblankmedia -libraryname <library name> -medialabel <media label> -allmedia -password -wait <NetVault:Backup password>

-libraryname: The name of the library to target. -medialabel: Media with label to search for. -allmedia: Indicates all media will be blanked in the library. -password: The NetVault:Backup password for the specified Server. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward. All of the required switches for this command begin with different letters. Therefore, this command could be input as follows: nvbulkblankmedia -l NVLibrary1 -m Backup* -p sunny wait -l - represents the -libraryname switch -m - represents the -medialabel switch -p - represents the -password switch

1.1.2.b

NetVault:Backup Names and the CLI


Conflicts will arise when a NetVault:Backup Server/Client or added backup device is named using an underscore character (_) and it is referenced in a NetVault:Backup CLI command. The CLI sees the use of an underscore in its syntax as a replacement for a space, because a space is not recognized. Therefore, if a machine whose actual name is NetVault_Server is included in a CLI command, NetVault:Backup will search for a machine named NetVault

12

Chapter 1 Introduction to the NetVault:Backup CLI Server. Not finding a machine with this name, the command will return a failed result. To remedy this, the following can be performed: Enclose in Quotes ( ) - Variable names that included underscores must be enclosed in quotes when input in the CLI (See the section that follows, Using Spaces in CLI Variables for more information on the use of quotes in the syntax).

1.1.2.c

Using Spaces in CLI Variables


Various CLI commands require that you input a variable when you use them (e.g., when setting a Job Title for a new job with the nvscanmedia command, the -library switch requires that you input the name of the library containing the media item to be scanned. If the variable contains spaces, ensure that the complete variable is enclosed in quotes ( ). Variables input with spaces that are not enclosed in quotes will be unrecognizable to the CLI and an error message will be returned.

Example of Syntax Required When Using Spaces


Using the nvscanmedia command, the following syntax would be used to accommodate for any spaces that may exist in the name of the target library: nvscanmedia -library NV Library 1

1.1.2.d

NetVault:Backup Environmental Variables and the CLI


Various switches used with commands in the CLI require that additional information be provided (i.e., variable(s) must be provided). In certain circumstances, the following NetVault:Backup environmental variables can be used in place of variable information, when applicable: NETVAULTCLIACCOUNT - Used to name the Account with access to use the CLI. NETVAULTCLIPASSWORD - Used to name the Password associated with the Account. NV_HOME - Path to the root of the NetVault:Backup installation directory (e.g., C:\Program Files\NetVault for a default installation of NetVault:Backup on a Windows-based system). NV_JOBCLIENT - The NetVault:Backup name of a target Client on which a job was run NV_JOBID - The Identification value assigned to the current job by NetVault:Backup NV_JOBTITLE - The title assigned to the current job NV_SERVERNAME - The backup server being used NV_SESSIONID - NetVault:Backup internal session Identification number

NetVault: Backup Command Line Interface Users Gude NV_USER_ARG - Arguments that have been passed on to the script

13

1.1.2.e

Command Exit Statuses


Various NetVault:Backup CLI commands will offer a numeric result once they are executed. This number represents the actual exit status of the command (i.e., whether or not the command completed successfully, and why). The following values can be revealed, based on the actual outcome: 0 - The command completed successfully 1 - The command failed 2 - Arguments given in the command are invalid (e.g., a variable named in the command is inaccurate).

1.1.3

The nvsetmodify.cfg File


Several of the commands explained in the sections that follow reference a file entitled nvsetmodify.cfg. This configuration file is comprised of a list of various NetVault:Backup functionality, each of which is accompanied by a numeric value. This number value can be used to identify its associated functionality in the CLI (i.e., with commands and switches that support its use). To access this file and view its contents, perform the following steps: 1. Navigate to the following sub-directory (where ... refers to the complete path to the local installation of NetVault:Backup): ...\netvault\util 2. Locate the file entitled, nvsetmodify.cfg and open it for viewing (e.g., with any text editing application). Various NetVault:Backup functionality will be listed with an accompanying number value. 3. Note the values for the desired functionality and close this file, without saving it.

Important:
1. Ensure that the nvsetmodify.cfg is not edited or modified in any manner. It is recommended that you print out this file and use this print for reference purposes. 2. This functionality is intended only for highly-experienced users. Therefore, it is strongly recommended that any attempt to use any of the values displayed in this configuration file when generating CLI commands be performed under the guidance of a BakBone Technical Support representative.

14

Chapter 1 Introduction to the NetVault:Backup CLI

1.2.0

Technical Support
BakBone Software is dedicated to providing friendly, expert advice to NetVault: Backup customers. Our highly trained professionals are available to answer questions, offer solutions and generally help make the most of any NetVault: Backup purchase. Log on to BakBones web site, or contact the Helpdesk.

1.2.1

Helpdesk Support Lines


Region North America Contact Telephone
1.877.955.BONE (2663)

E-mail
support@bakbone.com

Europe

Telephone
+44.1202.244727

E-mail
support@bakbone.co.uk

China

Telephone
+86.10.6567.3331

E-mail
support@bakbone.com.cn

Korea

Telephone
+82.2.501.3062

E-mail
koreasupport@bakbone.com

Asia/Pacific Rim

Telephone
+81.3.5908.3517

E-mail:
Multiple offices exist in our Asia, Pacific Rim district. Please contact the closest support office for assistance:

Japan Office:
support@bakbone.co.jp

India Office:
indiansupport@bakbone.com

South Pacific Office:


anzsupport@bakbone.com

Southeast Asia Office:


aseansupport@bakbone.com

1.2.2

BakBone Softwares Web Site


BakBones web site can be reached at the following address: http://www.bakbone.com

command line interface users guide

Chapter 2:

NetVault:Backup CLI Commands


2.0.0 - Using Command Line Executables ........................................................... 17
2.0.1 - Client Specific Command Line Executables .............................................................. 17 - 2.0.1.a - nvclientaccess .................................................................................................... 17 - 2.0.1.b - nvclientadd ......................................................................................................... 18 - 2.0.1.c - nvclientlist ........................................................................................................... 19 - 2.0.1.d - nvclientremove.................................................................................................... 19 2.0.2 - Device Specific Command Line Executables ............................................................ 20 - 2.0.2.a - asf_load_media................................................................................................... 20 - 2.0.2.b - asf_ release_drive ............................................................................................... 20 - 2.0.2.c - nvacslsmedia ...................................................................................................... 21 - 2.0.2.d - nvcheckdrive ...................................................................................................... 22 - 2.0.2.e - nvcleandrive ....................................................................................................... 23 - 2.0.2.f - nvclosedoor ......................................................................................................... 23 - 2.0.2.g - nvcloseeeport ..................................................................................................... 24 - 2.0.2.h - nvcloseeeportcleaning ......................................................................................... 24 - 2.0.2.i - nvdeviceeject ....................................................................................................... 25 - 2.0.2.j - nvexportmedia ..................................................................................................... 25 - 2.0.2.k - nvopendoor ........................................................................................................ 26 - 2.0.2.l - nvopeneeport ....................................................................................................... 26 - 2.0.2.m - nvresetdrivestats ................................................................................................ 27 - 2.0.2.n - nvsetcleaninglives ............................................................................................... 28 - 2.0.2.o - nvsetdrivecleaning............................................................................................... 29 2.0.3 - Media Specific Command Line Executables.............................................................. 30 - 2.0.3.a - nvblankmedia ..................................................................................................... 30 - 2.0.3.b - nvbulkblankmedia ............................................................................................... 31 - 2.0.3.c - nvlabelmedia ...................................................................................................... 33 - 2.0.3.d - nvlistblankmedia ................................................................................................. 34 - 2.0.3.e - nvmediadetails .................................................................................................... 34 - 2.0.3.f - nvremovemedia ................................................................................................... 35 - 2.0.3.g - nvreusemedia ..................................................................................................... 35 - 2.0.3.h - nvscanmedia ...................................................................................................... 36 - 2.0.3.i - nvsyncronizesilomedia .......................................................................................... 37 - 2.0.3.j - nvupdateserialnumber .......................................................................................... 37 2.0.4 - Job Specific Command Line Executables ................................................................. 38 - 2.0.4.a - nvexpiresaveset .................................................................................................. 38 - 2.0.4.b - nvjobabort .......................................................................................................... 38 - 2.0.4.c - nvjobcreate ......................................................................................................... 39

16

Chapter 2 NetVault:Backup CLI Commands

- 2.0.4.d - nvjobdelete ........................................................................................................ 42 - 2.0.4.e - nvjobhold ........................................................................................................... 44 - 2.0.4.f - nvjoblist .............................................................................................................. 45 - 2.0.4.g - nvjobmodify........................................................................................................ 45 - 2.0.4.h - nvjobresume ...................................................................................................... 47 - 2.0.4.i - nvsetcreate ......................................................................................................... 48 - 2.0.4.j - nvsetdelete ......................................................................................................... 55 - 2.0.4.k - nvsetexport ........................................................................................................ 56 - 2.0.4.l - nvsetimport ......................................................................................................... 57 - 2.0.4.m - nvsetmodify ....................................................................................................... 58 - 2.0.4.n - nvjobstart ........................................................................................................... 62 - 2.0.4.o - nvtrigger ............................................................................................................ 62 2.0.5 - NetVault Logs and the Command Line Interface ....................................................... 63 - 2.0.5.a - nvlogdump ......................................................................................................... 63 - 2.0.5.b - nvlogpurge ......................................................................................................... 64 - 2.0.5.c - nvreadlog ........................................................................................................... 65 2.0.6 - Other Command Line Executables ........................................................................... 66 - 2.0.6.a - bonedate ........................................................................................................... 66 - 2.0.6.b - getmachineid...................................................................................................... 66 - 2.0.6.c - nvlicenseinfo ...................................................................................................... 66 - 2.0.6.d - nvlicenseinstall ................................................................................................... 66 - 2.0.6.e - nvpassword........................................................................................................ 66 - 2.0.6.f - nvpluginaccess.................................................................................................... 67 - 2.0.6.g - nvreport ............................................................................................................. 67 - 2.0.6.h - nvsendmail ........................................................................................................ 67 - 2.0.6.i - nvsendopmsg ...................................................................................................... 68

NetVault: Backup Command Line Interface Users Gude

17

2.0.0

Using Command Line Executables


The sections that follow outline the use of NetVault:Backups CLI commands. Several sections exist here to break up commands based on their type and usage.

Important:
1. Prior to using any of the CLI commands illustrated in this chapter, please fully review Chapter 1: Introduction to the NetVault:Backup CLI on page 7 for complete details on the use of NetVault:Backups CLI utility, as well as any pre-requisites for use. 2. The commands covered for use in this guide are the only ones that are supported for use with NetVault. Any commands found in the ...\NetVault\util directory (or other NetVault directories) that are not covered in this guide are not supported and should not be used. BakBone Software can not be held accountable for any outcome that may result from the use of any non-supported CLI command(s).

2.0.1

Client Specific Command Line Executables


This section gives a list of available Command Line Executables that can be used in reference to NetVault:Backup Clients.

2.0.1.a

nvclientaccess
Use this command to check whether a Client machine can be accessed by the NetVault:Backup Server.
Syntax nvclientaccess [-client <client name>] | [-clients <client name>] | [-tdclients <DBSname>] [-password <password>]

-client/-clients: Accompany this switch with the NetVault:Backup name of the Client to check access to it. -tdclients: This switch is used exclusively for NetVault:Backup Clients with the Teradata Database software installed. Accompany this switch with the DBS name of the Teradata Client to check access to it. -password: This switch, accompanied with the password associated with the NetVault:Backup Client, must be used for a Client with security enabled.

18

Chapter 2 NetVault:Backup CLI Commands

2.0.1.b

nvclientadd
Use this command to add a NetVault:Backup Client to the Server. This command only works if issued from the NetVault:Backup Server itself.
Syntax nvclientadd [-client <client name> | -clientip <IP address>] [-clientgroup <clientgroup>] [-password <password>] [-timeout <timeout period>] [-version]

Important:
1. The Client should be available and running a valid installation of NetVault:Backup before it can be added to a NetVault:Backup Server using this command. 2. If security is enabled on the target Client, the -password switch must be used and the proper password value established for the target Client must be input. 3. If the Client is not available to the Server, the nvclientlist find <ipaddress> command can be used to locate the machine. Please see a description of this command on page 19. -client: Accompany this switch with the NetVault:Backup name of the Client to be added to the Server. -clientip: Accompany this switch with the IP address of the machine to be added as NetVault:Backup Client. -clientgroup: This switch specifies the name of the Client Group to which the Client is to be added.

Important: The Client Group to be used must exist before this command is used.
NetVault:Backup will not automatically create a Client Group if this switch is used. Client Groups must be created in the NetVault:Backup GUI (i.e., no CLI utility is offered for the creation of a Client Group). -password: If NetVault:Backup security is enabled on a target Client, this switch must be used, accompanied with the exact password value established for the Client. -timeout: This option specifies the period of time (in minutes) that NetVault will wait on the Client to approve the add request. If this period elapses and no Client addition has occurred, an error message will be displayed stating that the request has timed out and the Client could not be added. -version: This switch gives the build date of the NetVault:Backup distribution installed on the target Client.

NetVault: Backup Command Line Interface Users Gude

19

2.0.1.c

nvclientlist
Use this command for the following: To get a list of Clients added to the NetVault:Backup domain. To get a list of available NetVault:Backup Clients. To find a NetVault:Backup machine using either a specific NetVault:Backup name or IP address.
Syntax nvclientlist [-current [-name <client name>]] [-available [-name <client name>]] [-find <IP address>] [-version]

-current: This switch gives a list of Clients added to the NetVault:Backup domain. -available: This switch gives a list of available NetVault:Backup machines that can be added as Clients to the Server. -name: Accompany this switch with the NetVault:Backup name of the Client to be located. -find: Accompany this switch with the IP address of the machine to be located. -version: This switch gives the build date of the NetVault:Backup distribution installed on the target Client.

2.0.1.d

nvclientremove
Use this command to remove a Client from the domain controlled by the Server on which this command is run.
Syntax nvclientremove [-client <client name>] [-version]

-client: The NetVault:Backup name of the Client to be removed from the domain.

Important: The -client switch may only be used once per use of this command (i.e., it is
not possible to remove multiple NetVault Clients with a single use of the nvclientremove command). -version: This switch gives the build date of the NetVault:Backup distribution installed on the target Client.

20

Chapter 2 NetVault:Backup CLI Commands

2.0.2

Device Specific Command Line Executables


This section gives a list of available Command Line Executables that can be used in reference to various devices.

2.0.2.a

asf_load_media
This command loads the specified media into the drive and locks it in the drive as ASF media.
Syntax asf_load_media -m <media name> | -b <barcode> -d <device name> [-s <server name>] [-c <client name>] [-wait]

-m: This switch followed by the media label of the desired media. -b: This switch followed by the barcode of the desired media. -d: The name of the target drive. -s: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. -c: The NetVault:Backup name of the Client the device is attached to. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

2.0.2.b

asf_ release_drive
This command releases the lock previously placed on the specified device by the asf_release_drive command and allows the drive and the media to be used by NetVault:Backup.
Syntax asf_release_drive -d <device name> [-s <server name>] [-c <client name>]

-d: The name of the target drive. -s: The name of the NetVault Server to which the device is locally attached (i.e., in the event that the device is locally attached to the NetVault Server)

NetVault: Backup Command Line Interface Users Gude

21

-c: The NetVault:Backup name of the Client to which the device is attached (i.e., in the event the device is configured as a NetVault:Backup SmartClient). This switch is also used to name a remote NetVault:Backup Server that has the target device locally attached.

2.0.2.c

nvacslsmedia
Use this command to allocate/de-allocate media known to an ACSLS library.
Syntax nvacslsmedia [-allocate | -deallocate] [-medialabel <media label>] -libraryname <library name> [-servername <server name>] [-range <range-media >] [-file <filename >] [-version]

-allocate: Allocates the specified media. -deallocate: De-allocates the specified media. -medialabel: The switch followed by the media label or barcode of the desired media. Multiple labels/barcodes can be denoted by a comma separated list of values. -libraryname: The name of the target library. -servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -range: Accompany this switch with a range of media label/barcode values that correspond to a series of media to be de-allocated. include a hyphen (with no spaces) between the values. -file: This option can be used to specify the list of media labels or barcodes corresponding to the set of media that are to be de-allocated. Note that only one entry (media label or barcode) can be specified per line. -version: This switch gives the build date of the NetVault:Backup distribution.

22

Chapter 2 NetVault:Backup CLI Commands

2.0.2.d

nvcheckdrive
Use this command to check the status of the specified drive. For example, it can be used to check the status of a drive that was taken off-line for some reason. If successful, the specified drive will be returned to on-line status so that it is available to NetVault:Backup for future jobs.
Syntax nvcheckdrive -servername <server name> [-drivename <drive name>] [-libraryname <library name>] [-drivenumber <drive number>]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library. -drivename: Accompany this switch with the name of the target drive whose status is to be checked. -drivenumber: Accompany this switch with the drive number of the drive whose status is to be checked.

Important: If the -libraryname option is chosen to denote a library, then the -drivename or -drivenumber switch must be used to specify the desired drive. Examples of the Use of the nvcheckdrive Command
The examples below illustrate a few of the ways in which the different switches can be combined for the desired result: Standalone Drive - Checking the Status of a drive named Stndalone1 that is locally attached to the NetVault:Backup Server: nvcheckdrive -drivename Stndalone1 Library Drive (by Drive Name) - Checking the status of Drive 1 in a library device entitled NVLibrary that is locally attached to a NetVault:Backup Client named NVCLIENT1 nvcheckdrive -servername NVCLIENT1 -libraryname NVLibrary -drivename Drive 1

NetVault: Backup Command Line Interface Users Gude

23

Library Drive (by Drive Number) - Checking the status of Drive 2 in a library device entitled NVLib2 that is locally attached to a remote NetVault:Backup Server, with the NetVault:Backup name NVSERVER2 nvcheckdrive -servername NVSERVER2 -libraryname NVLib2 -drivenumber 2

2.0.2.e

nvcleandrive
Use this command to clean the library media. If the number of cleaning lives has been set for the media, it will be reduced by one when used for this process.
Syntax nvcleandrive -libraryname <library name> -librarydrivenumber <drive number>

-libraryname: The name of the target library. -librarydrivenumber: The drive number or the drive that is to be cleaned.

Example Use of the nvcleandrive Command


Below is an example of the syntax used to issue the nvcleandrive command to clean Drive 1 of a library entitled SONY LIB-162 using the predefined cleaning media. nvcleandrive -libraryname SONY LIB-162 -librarydrivenumber 1

2.0.2.f

nvclosedoor
Use this command in order to close the door of a library managed by the specified Server.
Syntax nvclosedoor [-servername <server name>] -libraryname <library name>

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library.

24

Chapter 2 NetVault:Backup CLI Commands

2.0.2.g

nvcloseeeport
Use this command in order to close the entry/exit port.
Syntax nvcloseeeport [-servername <server name>] -libraryname <library name> [-mediatype <media type>]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library. -mediatype: The type of media in the entry/exit slot.

2.0.2.h

nvcloseeeportcleaning
Use this command in order to close the entry/exit port of the specified library for importing a cleaning tape.
Syntax nvcloseeeportcleaning [-servername <server name>] -libraryname <library name> [-mediatype <mediatype>]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library. -mediatype: The type of media in the entry/exit slot.

NetVault: Backup Command Line Interface Users Gude

25

2.0.2.i

nvdeviceeject
Use this command to remove any media from a specified standalone drive.
Syntax nvdeviceeject -devicename <device name> [-servername <server name>] [-librarydrivenumber <drive number>] [-wait]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -devicename: The name of the target device or library. -librarydrivenumber: The number of the target drive in the library. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

Important: If the -libraryname option is chosen to demote a library then the -drivename or -drivenumber switch must be used to specify the desired drive. 2.0.2.j nvexportmedia
Use this command to export a piece of media from a tape library to its exit/entry (EE) port.
Syntax nvexportmedia [-servername <server name>] [-barcode <barcode> | -medialabel <medial label> | -slotspec <library name::slot number>] [-wait]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -barcode: This switch followed by the barcode number of the desired media. The barcode is to be preceded by an * (use only when searching by barcode).

26

Chapter 2 NetVault:Backup CLI Commands -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If media labels contain spaces, underscores (e.g., _) should be used in their place (e.g. my_media_1). -slotspec: This switch followed by the library name and slot number of the desired media. These two values must be separated using a double colon delimiter (e.g., ::). Use this switch only when searching by library slot. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

2.0.2.k

nvopendoor
Use this command in order to open the door of a library managed by the specified Server.
Syntax nvopendoor [-servername <server name>] -libraryname <library name>

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. In the event that the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library.

2.0.2.l

nvopeneeport
Use this command in order to open the entry/exit port for access to it.
Syntax nvopeneeport [-servername <server name>] -libraryname <library name>

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library.

NetVault: Backup Command Line Interface Users Gude

27

2.0.2.m

nvresetdrivestats
Use this command to reset the statistics for a specified drive.
Syntax nvresetdrivestats -servername <server name> [-libraryname <library name>] [-drivename <drivename>] [-drivenumber <drivenumber>] -action <action>

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library. -drivename: The name of the target drive. -drivenumber: The drive number assigned to the desired drive in a library. -action: The action to perform on the drive. The value that can accompany this switch include: drive: To reset drive statistics. clean: to reset drive cleaning statistics. all: To reset all statistics for the specified drive.

Important: If the -libraryname option is chosen to denote a library then the -drivename or -drivenumber switch must be used to specify the desired drive. Examples of the Use of the nvresetdrivestats Command
The examples that follow illustrate the use of this command with its associated switches to obtain a few of the available results. Reset Drive Statistics in a Standalone Drive - To reset the stats for a standalone drive named Stndalone1 that is locally attached to the NetVault:Backup Server. nvresetdrivestats -drivename Stndalone1 -action drive Reset Cleaning Statistics for a Library Drive (by Drive Name) - To reset the cleaning statistics for Drive 1 in a library device entitled NVLibrary that is locally attached to a NetVault:Backup Client named NVCLIENT1 nvresetdrivestats -servername NVCLIENT1 -libraryname NVLibrary -drivename Drive 1 -action clean

28

Chapter 2 NetVault:Backup CLI Commands Reset All Statistics for a Library Drive (by Drive Number) - To reset all statistics for Drive 2 in a library device entitled NVLib2 that is locally attached to a remote NetVault:Backup Server, with the NetVault:Backup name NVSERVER2 nvresetdrivestats -servername NVSERVER2 -libraryname NVLib2 -drivenumber 2 -action all

2.0.2.n

nvsetcleaninglives
Use this command to set the number of lives for a cleaning tape in the specified library device. The slot containing the cleaning tape is specified using the -slotnumber switch.
Syntax nvsetcleaninglives [-server <server name>] -libraryname <library name> [-slotnumber <slot number>] [-lives <lives>]

-server: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library. -slotnumber: The cleaning slot number in the library. -lives: The number of lives to be set for the cleaning media.

Example Use of the nvsetcleaninglives Command


A target library named ADIC_Library_6 is locally attached to the NetVault Server with the NetVault name NVSERVER. The syntax below will set the number of lives for a piece of cleaning media contained in slot 6, to seven (7): nvsetcleaninglives -server NVSERVER -libraryname ADIC_Library_6 -slotnumber 6 -lives 7

NetVault: Backup Command Line Interface Users Gude

29

2.0.2.o

nvsetdrivecleaning
Use this command to set the cleaning cycle for a specified library device.
Syntax nvsetdrivecleaning -libraryname <library name> -librarydrivenumber <drive number> -days <number of days> -dataxfersize <data transfer size> -hours <number of hours> -rwerrors <number of read/write errors> [-displayonly]

-libraryname: The name of the target library. -librarydrivenumber: The drive number of the drive for which the cleaning cycle has to be set. -days: The number of days the drive is to be used until a clean cycle. -dataxfersize: The size of data to be transferred before clean cycle. -hours: The number of hours the drive is to used until a clean cycle. -rwerrors: The number of read/write errors that can occur before a clean cycle. -displayonly: This option can be used to include additional details on the named device.

Important: Other than the -displayonly switch, all of the switches offered for use must be included in the syntax of a single command. Therefore, a value of -1 can be used with any of the above-mentioned switches in order to disable it completely. Example Use of the nvsetdrivecleaning Command
Three examples of usable syntax are displayed below that will set Drive 1 of a library entitled SONY LIB-162 to clean itself: Every 200 GB of Data Transfer Every 100 Hours of Drive Usage: If More than 100,000 Read/Write Errors Occur nvsetdrivecleaning -libraryname SONY LIB-162 -librarydrivenumber 1 -days -1 -dataxfersize 200 -hours 100 -rwerrors 1024

30

Chapter 2 NetVault:Backup CLI Commands

2.0.3

Media Specific Command Line Executables


This section gives a list of available Command Line Executables that can be used in regards to the media being used by NetVault:Backup.

Important:
1. A media item can be identified by its barcode (if one exists), its media label, or its slot position within a library when using CLI commands. 2. If media labels contain spaces, underscores (_) should be used in their place (e.g., my_media_1). 3. Various operating systems do not support the use of special characters when included in a medias label (e.g., :, !, @, #, $, %, ^, &, *, (, ), >, <, \, [, ], {, }, , or ). Therefore if a CLI command is issued to call out a piece of media whose label contains one of these characters, an error message may be revealed and the command will fail. Media labelled with any of these characters can only managed from the NetVault:Backup GUI (i.e., in the Media Management or Device Management windows).

2.0.3.a

nvblankmedia
Use this script to blank various media.
Syntax nvblankmedia [-servername <server name>] -barcode <barcode> | -medialabel <media label> | -slotspec <library name::slot number> [-wait]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -barcode: This switch followed by the barcode number of the desired media. The barcode is to be preceded by an * (use only when searching by barcode). -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If media labels contain spaces, underscores (_) should be used in their place (e.g., my_media_1). -slotspec: This switch followed by the library and slot number of the desired media (use only when searching by library slot). -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

NetVault: Backup Command Line Interface Users Gude

31

Important:
1. Blanking media completely removes ALL data from a selected piece of media. Use caution when blanking media. 2. This command removes all backup indexes for backups on the selected media from the NetVault:Backup databases.

Example Use of the nvblankmedia command


In the example syntax below, an individual piece of media contained in slot 21 of the library NV_Library_Large will be blanked. This library is locally attached to a NetVault:Backup Client named NVCLIENT1. nvblankmedia -servername NVCLIENT1 -slotspec 21::NV_Library_Large

2.0.3.b

nvbulkblankmedia
Use this command to bulk blank media.
Syntax nvbulkblankmedia -libraryname <library name> -medialabel <media label> [-allmedia] -password <password> [-wait]

-libraryname: Specifies the name of the library containing the media to be cleared. -medialabel: Specifies a common string that appears in the labels of all the media to be cleared. -allmedia: If this switch is included in the syntax, all media in the named library will be blanked. -password: Bulk blanking operations require that the NetVault:Backup Administrator password be input, which must be specified with this switch. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

Important:
1. Blanking media completely removes ALL data from a selected piece of media. Use caution when blanking media. 2. This command removes all backup indexes for backups on the selected media from the NetVault:Backup databases.

32

Chapter 2 NetVault:Backup CLI Commands

3. The Bulk Blank utility will not work on Servers on which security is disabled. 4. The library name and media label are case sensitive. 5. The wild card character *, used to represent a series of characters, is supported for the medialabel switch.

Example Use of the nvbulkblankmedia Command


Below is an example of the syntax used to bulk blank a series of media with the media label Full Backup Group 7. This media is contained in a library entitled ADICLib_1 nvbulkblankmedia -libraryname ADICLib_1 -medialabel Full Backup Group 7 -password netvaultadmin

2.0.3.c

nvexportmedia
Use this command to export a piece of media from within a tape library to its exit/ entry (EE) port.
Syntax nvexportmedia -servername <server name> -barcode <barcode> | -medialabel <media label> | -slotspec <lib::slot> [-wait]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -barcode: This switch followed by the barcode number of the desired media. The barcode is to be preceded by an * (use only when searching by barcode). -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If media labels contain spaces, underscores (_) should be used in their place (e.g. my_media_1). -slotspec: This switch followed by the library and slot number of the desired media. Use this switch only when searching by library slot. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

NetVault: Backup Command Line Interface Users Gude

33

2.0.3.d

nvlabelmedia
Use this command to label selected new media or re-label existing.

Important: Media that contain existing backups may not be re-labelled without first running either nvblankmedia or nvreusemedia commands.
Syntax nvlabelmedia [-servername <server name>] -barcode <barcode> | -medialabel <media label> | -slotspec <lib::slot> -newlabelname <new media label> [-newgroupname <new media group name>] [-newoffsitelocation <new off-site location name>] [-wait]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -barcode: This switch followed by the barcode number of the desired media. The barcode is to be preceded by an * (use only when searching by barcode). -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If media labels contain spaces, underscores (_) should be used in their place (e.g. my_media_1). -slotspec: This switch followed by the library and slot number of the desired media (use only when searching by library slot). -newlabelname: This switch followed by the new name desired for the selected piece of media. If the new media label is to contain spaces, underscores (_) should be used in their place (e.g.,my_media_1). -newgroupname: This switch followed by the new name desired for the selected group of media. If the new media group label is to contain spaces, underscores (_) should be used in their place (e.g., my_media_1). -newoffsitelocation: This switch followed by a new off-site location to be assigned to the selected piece of media. -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

34

Chapter 2 NetVault:Backup CLI Commands

2.0.3.e

nvlistblankmedia
Use this command to get a list of the slots containing blank media for a given NetVault:Backup Server and library.
Syntax nvlistblankmedia -servername [servername] -libraryname [library name]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the library.

2.0.3.f

nvmediadetails
Use this command to view details pertaining to a media item or media group.
Syntax nvmediadetails [-label <media label>] [-group <group label>] [-all] [-listlabels] [-listgroups] [-version]

-label: Accompany this switch with the media label of the media for which the details are to be viewed. -group: Accompany this switch with the media group label of the media group for which the details are to be viewed. -all: This option gives details pertaining to all individual media items that have been assigned a media label as well as media items belonging to different media groups. -listlabels: This option will give the details of all the media items that have been assigned a media label. The -group option can be used with this option for the details pertaining to the media items belonging to the specified group. -listgroups: Use this option for a list of media groups. -version: This switch gives the build date of the NetVault:Backup distribution.

NetVault: Backup Command Line Interface Users Gude

35

Examples
The example syntax below would be used to display the details of a single media item with the label MyTape. nvmediadetails -label MyTape The example syntax below would be used to display the details of all of the media items contained in the Media Group entitled, MyGroup. nvmediadetails -group MyGroup -all

2.0.3.g

nvremovemedia
Use this command to delete the media information from the NetVault:Backup database.

Important: The media has to be taken offline prior to issuing this command for deleting the media information.
Syntax nvremovemedia [-medialabel <media label>] [-displaymedialist] [-version]

-medialabel: Accompany this switch with the media label of the offline media that is to be removed from the NetVault:Backup database. -displaymedialist: This option gives details pertaining to all the media items that have been assigned a media label. -version: This switch gives the build date of the NetVault:Backup distribution.

2.0.3.h

nvreusemedia
Use this command in order to set specific media as reusable.
Syntax nvreusemedia [-servername <server name>] -barcode *<barcode> | -medialabel <media label> | -slotspec <library name::slot number>

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out.

36

Chapter 2 NetVault:Backup CLI Commands -barcode: This switch followed by the barcode number of the desired media. The barcode is to be preceded by an * (use only when searching by barcode). -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If media labels contain spaces, underscores (_) should be used in their place (e.g. my_media_1). -slotspec: This switch followed by the library and slot number of the desired media (use only when searching by library slot).

Important:
1. The nvreusemedia CLI command is not supported for use with ACSLS/ADIC DAS library systems. Attempts to use this command with these devices will be met with a failure message. 2. This command removes all backup indexes for backups on the selected media from the NetVault:Backup Databases.

2.0.3.i

nvscanmedia
Use this command to scan for and locate media of the selected type.
Syntax nvscanmedia [-servername <server name>] -barcode *<barcode> | -medialabel <media label> | -slotspec <library name::slot number> [-wait]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -barcode: This switch followed by the barcode number of the desired media. The barcode is to be preceded by an * (use only when searching by barcode). -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If media labels contain spaces, underscores (_) should be used in their place (e.g. my_media_1). -slotspec: This switch followed by the library and slot number of the desired media (use only when searching by library slot). -wait: This switch can be added to tell NetVault:Backup to wait until this task has completed before moving forward.

NetVault: Backup Command Line Interface Users Gude

37

Important:
1. This command can be used to import an item of media from another NetVault:Backup device, including media previously in a device controlled by a different NetVault:Backup Server. Prior to running this command, media of this type is recognized as FOREIGN and a restore of data from this media cannot be conducted until the media is scanned. 2. It writes backup indexes for all backups on the selected media to the NetVault:Backup databases (unless the index entry is already present in the database).

2.0.3.j

nvsyncronizesilomedia
Use this command to allocate all the known media in the specified ACSLS library.
Syntax nvsyncronizesilomedia [-servername <server name>] -libraryname <library name>

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library.

2.0.3.k

nvupdateserialnumber
Use this command to update the serial number of any drive in the specified library back to its original number.
Syntax nvupdateserialnumber [-servername <server name>] -libraryname <library name> [-bayname <bay name>] [-checkonly]

-servername: The NetVault:Backup name of the machine to which the target backup device is locally attached. If the device is locally attached to a NetVault:Backup Client (i.e., a NetVault:Backup SmartClient), this switch must be used to name that Client. If the device is attached to the local instance of the NetVault:Backup Server, this switch can be left out. -libraryname: The name of the target library. -bayname: The name of the drive bay that the target drive occupies in the named library. -checkonly: Use this option to check the media serial number.

38

Chapter 2 NetVault:Backup CLI Commands

2.0.4

Job Specific Command Line Executables


This section gives a list of available job-specific Command Line Executables available for use with NetVault:Backup.

2.0.4.a

nvexpiresaveset
Use this command to expire a backup saveset and remove its entry from the NetVault:Backup Database.
Syntax nvexpiresaveset -savesetid <saveset ID number> [-version]

-savesetid: The Saveset ID of the set to be expired.

Important: The -savesetid switch may only be used once per use of this command (i.e.,
it is not possible to expire multiple savesets with a single use of the nvexpiresaveset command). -version: This switch gives the build date of the NetVault:Backup distribution.

2.0.4.b

nvjobabort
This command allows a user to abort a job that is currently running. However, if the job is a scheduled one, it must actually be deleted from the NetVault:Backup GUI.
Syntax nvjobabort [-servername <server name>] -jobid <jobid> [-instanceid <instance ID #>]

-servername: The NetVault:Backup Server that is administering the job. If the job is being administered by a remote NetVault:Backup Server, this switch must be used to name that specific Server. If the local instance of the NetVault:Backup Server is administering the job, this switch can be left out of the syntax. -jobid: The NetVault:Backup Job ID of the job being aborted. -instanceid: The instance of the job being aborted.

Important: Unless one is specified, NetVault:Backup will assume the default instance ID is
1.

NetVault: Backup Command Line Interface Users Gude

39

2.0.4.c

nvjobcreate
Use this command to create a backup or restore job. A job can be created to be later submitted. This is done by submitting a job title and using pre-defined Selection Sets.
Syntax nvjobcreate [-server <server name>] -jobtitle <jobtitle> -type <job type> [-selectionsetname <backup/restore selection set name>] [-selectionoptionssetname <GUI-created backup options set name>] [-schedulesetname <schedule set name>] [-backupoption <backup option>=<value>] [-targetsetname <target set name>] [-advoptssetname <advanced options set name>] -submit -parameters <parameter file name> -version

-server: The NetVault:Backup Server that is to administer the job. If the job is to be administered by a remote NetVault:Backup Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is to be used to administer the job, this switch can be left out of the syntax. -jobtitle: Input the desired name for the job along with this switch. -type: Accompany this switch with the type of NetVault:Backup job to be created (e.g., -type backup or -type restore). The default job type is backup (i.e., if the -type switch is applied with no accompanying backup or restore variable, NetVault:Backup will assume the job is a backup job). -selectionsetname: Include the name of the Selection Set to be used with a backup/restore job with this switch. This can be a Selection Set that was created in the NetVault:Backup GUI, or one can be created from the command line, using the nvsetcreate command, described on page 48. -selectionoptionssetname: Backup Job Only - Include the name of a Set of Backup options that should be used with a job, with this switch. This swirch applies specifically to Backup Options Sets that were created and saved using the NetVault:Backup GUI (i.e., it is not possible to create a Set of Backup Options from the CLI -- you must either use this option to specify a Set created in the GUI, or individually specifiy Backup Options using the -backupotpion switch, explained below).

40

Chapter 2 NetVault:Backup CLI Commands -schedulesetname: The name of the Schedule Set used to set the schedule details for the job. The job will be scheduled to run immediately (i.e., the default settings for schedule will be used) if this option is not used. This set can be one that was created and saved in the NetVault:Backup GUI, or one can be created from the command line, using the using the nvsetcreate command that is described on page 48. -backupoption: This switch is used to set Backup Options for the job. The Tag ID of the window item to be set is required. This can either be the backup option name as recognized by the CLI, or a numeric value assigned to the option by NetVault:Backup. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (please see the section, The nvsetmodify.cfg File of Chapter 1 on page 13 for information on accessing and viewing this file). Input either of these values in place of the <field> variable, and input a boolean argument for the <Value> variable to enable/disable the option (i.e., True to enable, and False to disable).

Important:
1. This switch must be followed by a colon (:) and no spaces before or after the Tag ID (e.g., -backupoption:<Tag ID>=True/False. 2. The nvjobcreate command does not allow for the setting of Restore Options via a specific switch. Any desired Restore Options for use must be included in the creation of the Restore Selection Set to be used. The nvsetcreate command offers a switch that is used to incorporate Restore Options into the Restore Selection Set. For complete details, please see the section, nvsetcreate on page 48. -targetsetname: The name of the Target Set used to specify the target media and drive details. The default target options (as displayed in the NetVault GUI) are used if no Target Set is specified. This set can be one that was created and saved in the GUI, or one can be created from the command line, using the nvsetcreate command that is described on page 48. -advoptssetname: The name of the Advanced Options Set used to specify advanced backup/restore related options. The default Advanced Options (as displayed in the NetVault:Backup GUI) are used if no Advanced Options Set is specified for the backup or restore job. This set can be one that was created and saved in the NetVault:Backup GUI, or one can be created from the command line, using the nvsetcreate command that is described on page 48. -submit: If this switch is used, the job will be submitted and listed as an active job. If omitted, the job will be saved but NOT run or scheduled. The job may be scheduled at a later time using the nvjobmodify command.

NetVault: Backup Command Line Interface Users Gude

41

-parameters: Use this option to redirect nvjobcreate to read options from the specified parameter file. -version: This switch gives the build date of the NetVault:Backup distribution.

Examples of the Use of the nvjobcreate Command


Creating a Backup Job - The following syntax is input to create an Incremental backup job of a Backup Selection Set of data entitled NVCLIENT 1 Full Data Backup, using a schedule set that was created to have the job run at a later time (which is named Repeating 1). The job will be administered on the local instance of the NetVault:Backup Server, and it is to be named Incremental Backup of NVCLIENT1. nvjobcreate -jobtitle Incremental Backup of NVCLIENT1 -type backup -selectionsetname NVCLIENT 1 Full Data Backup -backupoption:ntfsopt_typeincr=true -schedulesetname Repeating 1 -submit Creating a Restore Job - The following syntax is used to submit a restore job entitled Restore of Full Backup that will run immediately. This backup was administered by a remote NetVault:Backup Server named NVSERVER2. The data items to be restored have been encompassed in a Restore Selection Set entitled RestoreFull. nvjobcreate -jobtitle Restore of Full Backup -servername NVSERVER2 -type restore -selectionsetname RestoreFull -submit

42

Chapter 2 NetVault:Backup CLI Commands

2.0.4.d

nvjobdelete
Use this command in order to delete jobs matching the criteria specified by the options from the scheduler.
Syntax nvjobdelete [-jobid <jobid>] [-type <job type>] [-jobrange <jobid-jobid>] [-jobtitle <job title>] [-client <client>] [-plugin <plugin>] [-selectionsetname <selection set name>] [-schedulesetname <schedule set name>] [-targetsetname <target set name>] [-advoptssetname <advanced options set name>] [-force] [-sheduleonly] [-version]

-jobid: Accompany this switch with the numerical job identification value assigned by NetVault to a single job that is to be deleted (e.g., -jobid 36).

Important: The -jobid switch may only be used once per use of this command (i.e., it is not possible to delete multiple jobs with a single use of the nvjobdelete command).
-type: Accompany this switch with the type of NetVault:Backup job to be deleted (e.g., -type backup or -type restore). This option should only be used if a specific job type is to be deleted (i.e., leave this option out of the syntax entirely if all NetVault:Backup job types are to be deleted). -jobrange: Accompany this switch with a range of job identification values that correspond to a series of jobs to be deleted, separated by a hyphen (e.g. -jobrange 30-45). -jobtitle: Accompany this switch with the name of the job enclosed in quotes (e.g., -jobtitle Full_Backup_1) to delete job(s) with a matching title. -client: Accompany this switch with the exact NetVault:Backup name of a NetVault:Backup Client that served as target for the jobs that are to be deleted (e.g., -client NV_Client_MKTG). All jobs performed using the named NetVault:Backup Client will be deleted.

NetVault: Backup Command Line Interface Users Gude

43

-plugin: Accompany this switch with the exact name of the NetVault:Backup APM/plugin used in the jobs that are to be deleted. Ensure that the APM/ plugin name is enclosed in quotes (e.g., -plugin File System). -selectionsetname: Accompany this switch with the name of a pre-defined backup/restore selection set that was used in the job(s) to be deleted. -schedulesetname: Accompany this switch with the name of a predefined schedule set that was used in the job(s) that are to be deleted. -targetsetname: Accompany this switch with the name of a predefined target set that was used in the job(s) that are to be deleted. -advoptssetname: Accompany this switch with the name of a predefined advanced options set that was used in the job(s) that are to be deleted.

Important: This applies to the use of the following switches with this command:
-jobtitle -client -plugin -selectionsetname -schedulesetname -targetsetname -advoptssetname In the event that any of these switches are used alone in the syntax of this command, all instances of a job that meet the parameters set in the switch will be deleted (e.g., nvjobdelete -plugin File System would result in all File System Plugin jobs being deleted). However, other switches can be used in conjunction to limit the total number of jobs deleted (e.g., if used in conjunction with the -jobrange switch, only jobs that fall into the Job ID range specified that meet the parameters set by one of these switches, will be deleted). -force: If a job that meets the parameters set by another switch is currently in the queue to be run (i.e., the job is scheduled to run at a later time), any attempt to delete it with this command will fail. Use of the -force switch in conjunction with other switches will cause any eligible jobs to be removed from the queue and therefore successfully deleted. -scheduleonly: Used in lieu of the -force switch, this switch can be used to only remove any eligible jobs from the job queue, but not actually delete them from the NetVault:Backup Database. -version: This switch gives the build date of the NetVault:Backup distribution.

44

Chapter 2 NetVault:Backup CLI Commands

Examples of the Use of the nvjobdelete Command


Delete by Job ID - The following command deletes the jobs whose IDs fall into any of the range: 1, 5, 7-12,15-19. nvjobdelete -jobid 1 -jobid 5 -jobrange 7-12 -jobrange 15-19 Delete All Instances of a Specific Job Type, Based on Job Title - The following command deletes all restore jobs with the job title No Title nvjobdelete -type restore -jobtitle No Title Delete All Jobs That Used a Specific Schedule Set on a Specific Client - The following command deletes all jobs that are using the Schedule Set FirstTuesday on the Client MyClient nvjobdelete -client MyClient -schedulesetname FirstTuesday -force

2.0.4.e

nvjobhold
Use this command to put a currently scheduled report job on hold temporarily. The job can be resumed using the nvjobresume command.
Syntax nvjobhold [-servername <server name>] -jobid <jobid> [-version]

-servername: The NetVault Server that is administering the job. If the job is being administered by a remote NetVault Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is administering the job, this switch can be left out of the syntax. -jobid: The Job ID of the job that is to be put on hold.

Important: The -jobid switch may only be used once per use of this command (i.e., it is only possible to place a hold on a single job with the nvjobhold command).
-version: This switch gives the build date of the NetVault distribution.

NetVault: Backup Command Line Interface Users Gude

45

2.0.4.f

nvjoblist
Use this command to list all active jobs.
Syntax nvjoblist [-servername <server name>] [-delimiter <delimiter>] [-title <title>] [-fixedcols] [-noheader] [-version]

-servername: The NetVault Server that is administering the job(s). If administered by a remote NetVault Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is being used to administer the job(s), this switch can be left out of the syntax. -delimiter: Use this option to specify the delimiter character that is used to separate fields. -title: Accompany this switch with the name of the job enclosed in quotes (e.g., -jobtitle Full_Backup_1) to list job(s) with a matching title. -fixedcols: Use this option to vertically align all the rows in the output. -noheader: Use this option if the header row is not required in the output. -version: This switch gives the build date of the NetVault distribution.

2.0.4.g

nvjobmodify
Use this option to modify a given job as described by the -change option(s).
Syntax nvjobmodify -jobid <jobid> -jobname <job name> -type <job type> -change <change description> [-submit] [-parameters <parameter file>] [-assign <assignment character>] [-delimit <delimiter character>] [-version]

46

Chapter 2 NetVault:Backup CLI Commands -jobid: Accompany this switch with the numerical job identification value assigned by NetVault:Backup to the single job that is to be modified (e.g., -jobid 36). This option is not required if the -jobname option is used. -jobname: Accompany this switch with the name of the job enclosed in quotes. This command will fail if more than one job with the given title is available on the Server. In such cases, use the -jobid option. -type: Accompany this switch with the type of NetVault:Backup job to be modified (e.g., -type backup or -type restore). -change: This switch is used to specify the changes that are to be made to the given job. Any number of values can be specified with this option. The <change description> is formatted as follows: <item>[:<field>]=<value> The <Item> variable refers to the name of the item in the job that is to be modified. The <Field> variable, if applicable, calls out a specific field in the item that is to be modified. Finally, the <Value> variable represents the change that will occur for the selected Item/Field. The following values can be input and used as the <item> variable: Title: To change the Job Title. Set: To change the Selection Set. <value> specifies the new set name. <field> may take any of the following values: BS: Backup Selection Set S: Schedule Set BT: Backup Target Options Set AB: Advanced Backup Options Set RS: Restore Selections Set AR: Advanced Restore Options Set Options: This switch is used to modify/add Backup Options to a job. The Tag ID for the actual backup option to be set is required. This can either be the backup option name as recognized by the CLI, or a numeric value assigned to the option by NetVault. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (please see the section, The nvsetmodify.cfg File of Chapter 1 on page 13 for information on accessing and viewing this file). Input either of these values in place of the <field> variable, and input a boolean argument for the <Value> variable to enable/disable the option (i.e., True to enable, and False to disable).

Important: This switch must be followed by a colon (:) and no spaces before or after the
Tag ID (e.g., Options:<Tag ID>=True/False).

NetVault: Backup Command Line Interface Users Gude

47

-submit: Use this option to schedule/re-schedule the given job following application of the changes. This option may also be used on its own in order to schedule jobs that have been created but not scheduled. -parameter: Use this option to redirect nvjobmodify to read options and their values from a given parameter file. -assign: The character used for assignment in change descriptions may be changed using the -assign option. This option must be used if old or new values contain the default assignment character =. -delimit: The character used as a delimiter in change descriptions may be changed using the -delimit option. This option must be used if old or new values contain the default delimiter :. -version: This switch gives the build date of the NetVault:Backup distribution.

Example Use of the nvjobmodify Command


A job entitled Backup File System 10-15 was previously created to perform a File System backup for a Windows Client. The following syntax would be used to change the job to perform an incremental backup instead of a full backup. nvjobmodify -jobname Backup File System 10-15 -change Options:ntfsopt_typeincr=true

2.0.4.h

nvjobresume
Use this command to resume a job previously put on hold.
Syntax nvjobresume [-servername <server name>] -jobid <jobid> [-version]

-servername: The NetVault Server that is administering the job. If the job is being administered by a remote NetVault Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is administering the job, this switch can be left out of the syntax. -jobid: The Job ID of the job to be resumed.

Important: The -jobid switch may only be used once per use of this command (i.e., it is not possible to resume multiple jobs with a single use of the nvjobresume command).
-version: This switch gives the build date of the NetVault distribution.

48

Chapter 2 NetVault:Backup CLI Commands

2.0.4.i

nvsetcreate
Use this command to create a Selection Sets of different types using the available options.
Syntax nvsetcreate [-version] [-setname <set name>] -type <set type> <set type specific options> -assign <assignment character> -delimit <delimiter character> -parameters <parameter file name>]

Important: A list of the permitted options for any set type may be obtained with the
command nvsetcreate type <set type>. -setname: Use this switch to specify a name for the Set to be created. -type: Use this switch to specify the set type. The <set type> value must be one of the following: BS: Backup Selections Set S: Schedule Set BT: Backup Target Set AB: Backup Advanced Options Set RS: Restore Selections Set AR: Restore Advanced Options Set -set type specific options: These are described in the sections that follow, and are dependant upon the type of set to be created. -assign: The character used for assignment may be changed using this option. This switch must be used if any user input variable (e.g., a file name or directory path) contains the equal sign (=), because it serves as the default assignment character. -delimit: The character used as a delimiter may be changed using this option. This switch must be used if any user input variable (e.g., a file name or directory path) contains a colon (:), because it serves as the default delimiter character. -parameters: This switch redirects nvsetcreate to read options and their arguments from the given parameter file. An example parameter file is given following the descriptions of the various options. -version: This switch gives the build date of the NetVault distribution.

NetVault: Backup Command Line Interface Users Gude

49

Switches for Creating Backup Selection Sets


-client <client>: The NetVault name of the Client to be backed up. -plugin <plugin>: Accompany this switch with the exact name of the NetVault APM/plugin used to perform the backup. Plugin names should appear exactly as they do in the GUI. (e.g. -plugin File System). -include <path>: This switch specifies the path to be backed up. It should consist of the names of each node below the selected item in the tree as they appear in the Backup window of the GUI (each separated by the proper delimiter, / or \ based on the operating system in use on the target Client). -exclude <path>: This switch specifies the path to be excluded from the backup. It is specified in the same way as the included paths.

Important: This switch can only be used to exclude items that appear in the file system
tree below items that have already been named for inclusion. -info <path=value[:value[:]]>: Some plugins add extra information to nodes in the selection tree. This may be information that would otherwise be unavailable to the plugin at backup time. This information can be specified with the -info switch, but only for nodes where default values are always added by the plugin. The type and order of the values specified is plugin dependant. For more information contact BakBone Support. Example Backup Selection Set Creation In the example that follows a Windows-based Client with the NetVault name WinClient is the target of a File System Plugin backup job in which files in a directory entitled work on its C:\ partition are to be backed up. However, all files with the .txt extension are to be excluded. nvsetcreate -setname workbackup -type BS -client WinClient -plugin File System -include C:\work -exclude C:\work\*.txt

Switches for Creating Restore Selection Sets


-client <client>: The NetVault name of the Client to be backed up. -plugin <plugin>: Accompany this switch with the exact name of the NetVault APM/plugin used to perform the backup. Plugin names should appear exactly as they do in the GUI. (e.g. -plugin File System). -saveset <n>: Accompany this switch with the ID of Saveset containing the data to be restored. If this option is not used then the -title option must be used instead. -title <title>: Accompany this switch with the job title of the backup job performed. If more than one Saveset exists for the job then the oldest will

50

Chapter 2 NetVault:Backup CLI Commands be used. It this option is not used then the -saveset option must be used instead. -include <path>: This switch specifies the path to be restored. It should consist of the names of each node below the selected item in the tree as they appear in the NetVault GUIs Restore window (each separated by / or \ on the Windows File System Plugin). -exclude <path>: This switch specifies the path to be excluded from the backup. It is specified in the same way as included paths.

Important: This switch can only be used to exclude items that appear in the file system
tree below items that have already been named for inclusion. -rename <path> =<new name or path>: Use this switch if the restored item has to be renamed or relocated. It is possible to combine rename and relocation functionality, or use each independently. If the item is only to be renamed, then only the new name should be given. For relocating items, the full path should be specified. Example Syntax for a Rename Only (i.e., the selected file will be restored to it original backup destination, but with a new file name): -rename /usr/joe/diary=diary.old Example Syntax for a Relocation Only (i.e., the selected file will maintain its existing file name, but it will be restored to a new location): -rename /usr/joe/diary=/home/joe/diary Example Syntax for Simultaneous Rename and Relocate (i.e., the selected file will be given a new name and it will be restored to a different directory/volume): -rename /usr/joe/diary=/home/joe/diary.old

Important:
1. As noted in the description of the -assign switch on page 48, if a rename value or relocation path to be used contains an = character, then the assignment character must be changed with the -assign switch. 2. If relocating data to a different directory, the new target directory must exist on the target machine before execution of the restore command (i.e., you must manually create the desired target directory if it doesnt already exist). NetVault will not automatically create a new directory. -restoreoption <option=value>: This switch is used to add Restore Options (if any are available for use with the target APM/Plugin). The Tag ID of the window item to be set is required. This can either be the restore option name as recognized by the CLI, or a numeric value assigned to the option by

NetVault: Backup Command Line Interface Users Gude

51

NetVault. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (please see the section, The nvsetmodify.cfg File of Chapter 1 on page 13 for information on accessing and viewing this file). Input either of these values in place of the <field> variable, and input a boolean argument for the <Value> variable to enable/disable the option (i.e., True to enable, and False to disable).

Important: This switch must be followed by a colon (:) and no spaces before the Tag ID
(e.g., -restoreoption:<Tag ID>) -restoretarget <client>: Use this switch to specify the name of the Client to restore the selected items to. By default items are restored to the same Client that they were backed up from. The selected plugin must have been installed on the Client for this operation to be successful. -info <path=value[:value[:]]>: Use this switch to specify alternate values for items in a nodes plugin information. The type and order of the values specified is plugin dependent. For more information, please contact BakBone Support. Example Restore Selection Set Creation Below is an example of the syntax used to create a restore selection set named restorebig that is to be restored to the Client isp9039. The backup was performed using the the File System Plugin and the target backup saveset has been assigned the ID 320 by NetVault. The entire volume is to be restored except for a directory name a1 and the file document is to be relocated from the directory /usr/var to usr/tmp. Lastly, the Restore Option, Overwrite Newer Files is to be set to enabled, to allow for overwriting. nvsetcreate -setname restorebig -type RS -client isp9039 -plugin File System -saveset 320 -include /-exclude /a1 -rename /usr/var/document=/usr/tmp/document -restoreoption:NVFSOPT_OVERNEW=TRUE

Switches for Creating Backup/Restore Options Sets


Backup Options Sets - For backup jobs, any required Backup Options can not be specified in a Set using the nvsetcreate or nvsetmodify commands. Backup Options are specified during the creation of the backup job in the CLI, and can be specified in one of two ways: Manually Input From the CLI, During Job Creation - Through the use of the -backupoptions switch, that is available for use with the nvjobcreate command when creating a new backup job (see the description of this switch on page 40); or through the use of the -change:options switch available for use with the nvjobmodify

52

Chapter 2 NetVault:Backup CLI Commands command, for existing backup jobs (see the description of this switch on page 46). Through the Use of a Backup Options Set Created in the GUI - If you have created a Backup Options Set using the NetVault GUI, you can call it out for use during creation of a CLI job by including its exact name with the -selectionoptionsetname switch. Restore Options Sets - In difference to Backup Options, Restore Options can not be established during job creation (i.e., no switch is provided to do so with the nvjobcreate command). Restore Options are specified using the -restoreoption switch that is available for use with the nvsetcreate or nvsetmodify commands (see the description of this switch on page 50). Once the Selection Set is saved, when it is called out using the nvjobcreate command, the Restore Options saved in the Set will be utilized.

Switches for Creating Schedule Sets


-schedule <value>: The type of schedule to be created. Permitted values are immediate, once, repeating or triggered. -time <hh:mm>: The time of day to run the schedule (e.g., -time 11:36). -date <dd mmm yyyy>: The date the schedule will start from (e.g., -date 12 Dec 2004). -weekdays <ddd[,ddd[,]]>: Use this switch to specify the weekday(s) the scheduled job is to be run (e.g. -weekdays Mon, Tue, Wed, Thu, Fri). -weeks <n[,n[,]]>: Use this switch to specify the weeks in the month the scheduled job is to be run. Use L to specify the last week in the month (e.g., weeks 1, 3 L). -monthdays <n[,n[,]]>: Use this switch to specify the dates in the month the scheduled job is to be run. Use L to specify the last day of the month. (e.g., monthdays 7, 14, 21, L). -every <n-period>: Use this switch to specify the time interval for scheduled jobs that are to be run after a fixed period. The interval is specified as number of hours, days, weeks or months. A hyphen (-) is used to separate the quantity and period. (e.g., -every 12-months). -trigger <trigger>: Use this switch to specify the name of the trigger used to run a triggered job. Example Schedule Set Creation Below is an example of the syntax that would be used to create a Schedule Set entitled, EveryLastTues that will launch a job at 11:30 pm on the last Tuesday of every month: nvsetcreate -type S -setname EveryLastTues -schedule repeating -time 23:30 -weekdays tue -weeks L

NetVault: Backup Command Line Interface Users Gude

53

Switches for Creating Backup Target Sets


-device <name>: Use this switch to specify the name of a device or library to be used. This option can be used more than once in the command. If no devices are specified then the target set will default to Any Device. -librarydrivenumber <n>: Use this switch to specify the drive within a library to be used. This option must be preceded by a -device option giving the name of the library. If more than one drive may be used then each should be specified separately with -librarydrivenumber options. -anymedia: Use any media, including those in groups, for the backup. If this option is not specified, by default any media (except those which belong to a group) will be used. -mid <mid>: Use the media with the specified media ID. -group <group>: Use any media in the specified media group. -autolabel <bool>: This switch is used to label blank media.The values that can be used are true or false. The default value for this option is true. -reusemedia <value>: The values that can be used with this option are never (never reuse media), any (reuse any media) or group (reuse any media). -minimumspace <n>: Use this switch to set the minimum space (in megabytes) required on an item of media for that media to be used for backup. -protectmedia <bool>: If true prevents the media used from being used for further backups. The default value for this option is false. -firstonmedia <bool>: Controls whether backup is first on media. The default value for this option is false. Example Backup Target Set Creation Below is an example of the syntax used to create a Backup Target Set that will use either drive 3 or drive 4 of a library entitled, MyDltLib. This set will write to any media (regardless of group), and will automatically label or reuse media as required: nvsetcreate -type BT -setname Drive4 -device MyDltLib -librarydrivenumber 3 -librarydrivenumber 4 -anymedia -autolabel TRUE -reusemedia any

54

Chapter 2 NetVault:Backup CLI Commands

Switches for Creating Backup Advanced Options Sets


-backuptype <value>: This option can take the values backup (for backups) or archive (for archives). -discardtime <n-period>: Use this switch to control the period of time after which the backup is discarded (i.e., any media used by it may be automatically re-used). The period specified may be in days, weeks or years (e.g. -discardtime 26-weeks). -backuplife <n>: Use this switch to control the number of full backups that will be retained for this job. Any older backups are automatically discarded. -netcompress <bool>: Use this switch to specify whether network compression is to be used for data that is transferred between NetVault Client and Server. By default the data is not compressed. -verify <bool>: Accompany this switch with the value true if verification has to be done. The default value is false. -duplicate <bool>: Use this switch if the backed up data has to be duplicated. The default value is false. -duplicatescheduleset <set>: Use this option to specify the name of Schedule Set to be used when scheduling the duplication phase of the job. -duplicatetargetset <set>: Use this option to specify the name of a backup Target Set to be used when performing the duplication phase of the job. -migrate <bool>: If set to true the original backup is discarded following the creation of the duplicate copy. -duplicatelife <n-period>: Use this switch to specify the lifetime of the duplicate copy of the backup. If none is given then the lifetime of the original (specified with the -discardtime option) is used. -prescript <value>: Accompany this switch with the name of a script to be run before the backup is performed. Scripts must be contained in the ...\NetVault\scripts directory (where ... refers to the complete path to the installation of NetVault). -prescriptarg <value>: Accompany this switch with the value to be given as the user argument to the pre script. -postscript <value>: Accompany this switch with the name of a script to be run after the backup has been performed. -postscriptarg <value>: Accompany this switch with the value to be given as the user argument to the post script.

NetVault: Backup Command Line Interface Users Gude Example Backup Advanced Options Set Creation

55

In the example that follows, the proper syntax is revealed for an backup advanced options set named AdvOptBU with a backup life of 5 full backups, with network compression enabled; is to be verified and is to run a postscript entitled jobdone. nvsetcreate -type AB -setname AdvOptBU -backuplife 5 -netcompress TRUE -verify TRUE -postscript jobdone

Switches for Creating Restore Advanced Options Sets


-netcompress <bool>: This switch is used to specify whether network compression is to be used for data that is transferred between NetVault Client and Server. The default value is false. -prescript <value>: Accompany this switch with the name of a script to be run before the restore is performed. -prescriptarg <value>: Accompany this switch with the value to be given as the user argument to the pre script. -postscript <value>: Accompany this switch with the name of a script to be run after the restore has been performed. -postscriptarg <value>: Accompany this switch with the value to be given as the user argument to the post script.

2.0.4.j

nvsetdelete
Use this command to delete the named set of the given type from the NetVault Server.
Syntax nvsetdelete -setname <set name> [-type <set type>] [-version]

-setname: Accompany this switch with the name of the set to be deleted. -type: Use this option to specify the set type. It can take one of the following values: BS: Backup Selections Set S: Schedule Set BT: Backup Target Options Set AB: Advanced Backup Options Set RS: Restore Selections Set AR: Advanced Restore Options Set -version: This switch gives the build date of the NetVault distribution.

56

Chapter 2 NetVault:Backup CLI Commands

2.0.4.k

nvsetexport
Use this command to export the named set(s) of the given type from the NetVault Server to the output file.
Syntax nvsetexport [-setname <name>] -type <set type> -file <output file> [-version]

-setname: Use this switch to specify the set name. More than one set may be exported by repeating this option with different set names in the command. If this option is not used then all sets of the specified type are written to the output file.

Important: A space in the set name may be indicated using an exclamation character !.
For example, the set name my schedule set name can be input as my!schedule!set!name. -type: This option is used to specify the type of set(s) to be exported. It can take one of the following values: BS: Backup Selections Set S: Schedule Set BT: Backup Target Options Set AB: Advanced Backup Options Set RS: Restore Selections Set R: Advanced Restore Options Set -file: Accompany this switch with the name of the file to be created. -version: This switch gives the build date of the NetVault distribution.

Examples of the Use of the nvsetexport Command


The following command exports all Schedule Sets to the file schedules.nss. nvsetexport type S file schedules.nss The following command exports the Backup Selection Sets Blackbird and Robin to the file bandr.nss. nvsetexport type BS setname Blackbird setname Robin file bandr.nss

NetVault: Backup Command Line Interface Users Gude

57

2.0.4.l

nvsetimport
Use this command to import the named set(s) from the input file to the NetVault Server.
Syntax nvsetimport -file <input file> [-setname <name>[=<new name>]] [-assign <assignment character>] [-version]

-file: Accompany this switch with the name of the file to be read. -setname>[=<newname>]: One or more -setname options may be specified to select specific sets from the file. Each may be renamed if required. If no setname option is present then all sets in the input file are imported, each retaining their original name. Note that if a set already exists with the given name then it will not be overwritten. -assign: The character used for assignment may be changed using this option. It must be used if values contain the default assignment character =. -version: This switch gives the build date of the NetVault distribution.

Examples of the Use of the nvsetimport Command


The following example imports all sets from the file schedules.nss. nvsetimport -file schedules.nss The following example imports the set Robin from the file bandr.nss, renaming the imported set to Ptarmigan. nvsetimport -file bandr.nss -setname Robin=Ptarmigan The following example imports the set Blackbird from file bandr.nss, renaming the set. nvsetimport -file bandq.nss -assign @ -setname Blackbird@b=k

58

Chapter 2 NetVault:Backup CLI Commands

2.0.4.m

nvsetmodify
Use this command to modify the given set, as described by the change option(s).
Syntax nvsetmodify -setname <set name> -type <set type> -change <change description> [-parameters <parameter file>] [-assign <assignment character>] [-delimit <delimiter character>] [-version]

-setname: Accompany this switch with the name of the set to be modified. -type: Use this option to specify the type of the set. The following values are supported for use: BS: Backup Selections Set S: Schedule Set BT: Backup Target Options Set AB: Advanced Backup Options Set RS: Restore Selections Set AR: Advanced Restore Options Set -change <change description>: Changes to be made to the set are specified using this option. More than one change option may be specified if required. The <change description> variable is formatted as follows, for each desired change to a set: <item>[:<field>][:<old value>]=<new value> The <item> variable refers to the name of the item in the set to be modified. The following values can be used as an <item> variable:

Important: Some examples of the use of the -change switch in use for a selection set
are described in the sections, Example - Modifying a Backup Selection Set on page 61 and Example - Modifying a Restore Selection Set on page 61. Tree: Used to change items in the selection tree (Backup Selection Sets and Restore Selection Sets only). Following are the values that can be input as the <field> variable, when Tree is set as the <item>. path: When input as the <field> variable, the <old value> variable symbolizes the full path to the target data items in the existing selection set (i.e. input the path that is to be changed). Input a new value for the

NetVault: Backup Command Line Interface Users Gude

59

<new value> variable that will serve as the new path to target data for this selection set. Alternatively, the <old value> can contain the name of the Client or plugin, and the <new value> can be the new Client or plugin.

Important: If no <new value> variable is established, anything that is currently selected/ omitted in the path named as the <old value> will be considered de-selected by NetVault when this command is executed to modify the Set.
rename: This switch allows you to add a new rename/relocation command to a restore selection set or modify an existing one. The <old value> variable refers to the full path to the desired item. The <new value> variable refers to the new name or the new path for the selected item. Adding a New Rename/Relocation Command to an Existing Restore Selection Set - Input the desired rename/relocation targets information as the <old value> variable and input the desired new rename/relocation information as the <new value> variable. Modifying an Existing Rename/Relocation Command in an Existing Restore Selection Set - Input the Exact rename/ relocation command syntax originally created as the <old value> variable, and input the new rename/relocation syntax as the <new value> variable.

Important: For complete details on the proper syntax used for the Rename command,
please see the description of this switch offered on page 50. info: Modifies the plugin information object attached to a node in the selection tree. The value input as the <old value> variable should be the full path (from the plugin root node) to the required item. The value input as the <new value> variable should be the new values for the plugin information object, separated by colons (:). If any field is to remain unchanged, no value should be given (i.e., use a double colon in its place ::). <Node Name> or <ID>: This refers to the name of the root node marked for inclusion in the restore/backup job as revealed by NetVault. This may either be the node name as recognized by the CLI, or a numeric ID assigned to the node by NetVault. Both of these values are revealed beneath the [Tree Nodes] heading in the nvsetmodify.cfg configuration file (please see the section, The nvsetmodify.cfg File of Chapter 1 on page 13 for information on accessing and viewing this file). Input the value (i.e., node name or ID)

60

Chapter 2 NetVault:Backup CLI Commands that applies to the existing node in place of the <old value> variable; and input the new value for the new root node as the <new value> variable to modify the set.

Important:
1. The actual node name should be input as the <old value> variable when the selection tree for the target Client contains multiple nodes of the given type (i.e., rather than the ID value). 2. If no <new value> variable is established, anything that is currently selected/omitted in the <Node Name> or <ID> named as the <old value> will be considered de-selected by NetVault when this command is executed to modify the Set. Options: This switch is used to add/modify Restore Options (if any are available for use with the target APM/Plugin). The Tag ID of the window item to be set is required. This can either be the restore option name as recognized by the CLI, or a numeric value assigned to the option by NetVault. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (please see the section, The nvsetmodify.cfg File of Chapter 1 on page 13 for information on accessing and viewing this file). Input either of these values in place of the <field> variable, and input a boolean argument for the <Value> variable to enable/ disable the option (i.e., True to enable, and False to disable).

Important:
1. This switch must be followed by a colon (:) and no spaces before the Tag ID (e.g., Options:<Tag ID>=True/False). 2. For backup jobs, any required Backup Options must be specified/modified when the job is created (i.e., Backup Options can not be modified in a Set using nvsetmodify command). This can be accomplished through the use of the -backupoptions switch available for use with the nvjobcreate command when creating a new backup job (see the description of this switch on page 40); or through the use of the -change:options switch available for use with the nvjobmodify command, for existing backup jobs (see the description of this switch on page 46). Target: Used to change items in the target tree (Restore Selection Sets only). The <field> variable is used to specify the type to be changed. The only permitted value is a valid NetVault Client name. The <new value> specifies the new target Client. -parameters: This switch redirects nvsetmodify to read options and their arguments from the given parameter file. -assign: The character used for assignment may be changed using this option. It must be used if values contain the default assignment character (i.e., the equal sing -- =).

NetVault: Backup Command Line Interface Users Gude -delimit: The character used as a delimiter may be changed using this option. It must be used if values contain the default delimiter : -version: This switch gives the build date of the NetVault distribution.

61

Example - Modifying a Backup Selection Set


A Backup Selection Set named BackSet1 has been created to perform a File System Plugin backup for a Windows-based Client entitled WinClient1. The following command will change the set to backup the Client WinClient2 instead. nvsetmodify setname BackSet1 type BS change Tree:Client=WinClient2

Important: If performing this type of modification to a Backup Selection Set, the new target Client must have a the same root node in its file system as the original target Client. For example, if the Backup Selection Set was originally created to target the volume /usr/var/ docs as its root node, the new target Client must also contain this same node, otherwise the backup would fail. Example - Modifying a Restore Selection Set
A Restore Selection Set entitled, RestoreSet1 was created for a Windowsbased Client to restore several directories, including the contents of the directory C:\mail, to target system WinClient1. The following syntax would be used to restore the backup to a different Client entitled, WinClient2. In addition, a switch is included telling NetVault to overwrite newer files, and perform the restore to a different directory (i.e., to the directory C:\MyMail instead of C:\mail on the new Client). Lastly, the leading character in the change description for the data relocation is the @ character. This is done so that the : character may be used in the relocation path information. nvsetmodify -setname BackSet2 -type RS -change target:client:WinClient1=WinClient2 -change options:nvfs_opt_overnew=true -change @tree@path@c:\mail=c:\MyMail

62

Chapter 2 NetVault:Backup CLI Commands

2.0.4.n

nvjobstart
Use this command to run a saved job using the proper Job ID.
Syntax nvjobstart [-servername <server name>] -jobid <job id> [-wait] [-version]

-servername: The NetVault Server that is to administer the job. If the job is to be administered by a remote NetVault Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is to be used to administer the job, this switch can be left out of the syntax. -jobid: The Job ID of the job to be run. -wait: This switch can be added to tell NetVault to wait until this task has completed before moving forward. -version: This switch gives the build date of the NetVault distribution.

2.0.4.o

nvtrigger
Use this command in order to trigger a NetVault job that has already been predefined in the NetVault GUI and saved as a triggered job (via the Triggered option of the Schedule tab -- for complete details on this option, please see NetVault: Backup - Administrators Guide).

Important: This command is not located in the ...\netvault\util directory, and can be
found in the following directory: ...\netvault\bin
Syntax nvtrigger [-servername <server name>] -trigger <trigger name> [-wait]

-servername: The name of the NetVault Server that will administer the job. If the job is to be administered by a remote NetVault Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is to be used to administer the job, this switch can be left out of the syntax. -trigger: The name of the trigger to be used.

NetVault: Backup Command Line Interface Users Gude

63

-wait: Used to set an interval of time (in milliseconds) that NetVault will wait before actually launching the named trigger (e.g., the correct syntax used would be: nvtrigger -servername <server name> -trigger <triggername> -wait <time in milliseconds> <triggername>).

Important: The nvtrigger command will return a numerical value after its associated job has completed/ended. This number indicates the status of the job performed. The return values and the corresponding job status are listed below:
0: Backup Completed 1: Backup Failed 2: Backup Completed with Warnings 3: Backup Aborted

2.0.5

NetVault Logs and the Command Line Interface


NetVault offers various Command Line Executables that can be used in the management of NetVault log entries. These allow the user to view, purge and even dump log entries to a specified file. The section that follows outlines these available CLI executables.

2.0.5.a

nvlogdump
Use this command to dump NetVault log entries that were taken between a specified period of time to a text file for external viewing.
Syntax nvlogdump [-jobid <job id number>] [-filename <filename>] [-text] [-starttime <YYYYMMDDHHMMSS>] [-endtime <YYYYMMDDHHMMSS>]

-jobid: NetVault assigns a Job ID to each job run. This number can be input to have only logs recorded that apply to that specific job, dumped to a file. -filename: The name that will be assigned to the completed text file. -text: Variable set to have a text file created. -starttime: The time that is to serve as a starting point for the dump file. -endtime: The time that is to serve as a stopping point for the dump file.

64

Chapter 2 NetVault:Backup CLI Commands

Important:
1. At least the jobid variable or a combination of the starttime/endtime variables must be set to properly use this command. However, a combination of the jobid and starttime/endtime variables can be set to achieve the desired log dump (e.g., a specific jobid can be set and a starttime/endtime set so that only logs belonging to the jobid that occurred within the set date range will be dumped to file). 2. When inputting a value for either the starttime or endtime variables, the number of characters input for each time unit must be correct: YYYY - Four digits for the year. MM - Two digits for the month (preface single digit months with a zero - 02). DD - Two digits for the date (preface single digit dates with a zero - 09). HH - Two digits for the hour of the day. (Works on a 24 hour time clock. Therefore a value of 08 represents 8:00 AM.) MM - Two digits for the minute (preface single digit minute values with a zero - 05). SS - Two digits for the second (preface single digit second values with a zero -02).

Example Use of the nvlogdump Command


The example below dumps the log for Job 31, from 21st February 1980 at 8:33pm and 4 seconds, to a binary file named nvlogdmp.nlg. nvlogdump -filename c:\temp\nvlogdmp -starttime 19800221203304 -jobid 31

2.0.5.b

nvlogpurge
Use this script to purge all NetVault log entries from the NetVault Database up to a specified point in time.
Syntax nvlogpurge -purgetime <YYYYMMDDHHMMSS>

-purgetime: The specific point in time that is to serve as a stopping point for the purge. When inputting a value for the purgetime variable, the number of characters input for each time unit must be correct: YYYY - Four digits for the year. MM - Two digits for the month (preface single digit months with a zero 02). DD - Two digits for the date (preface single digit dates with a zero - 09). HH - Two digits for the hour of the day. (Works on a 24 hour time clock. Therefore a value of 08 represents 8:00 AM.)

NetVault: Backup Command Line Interface Users Gude

65

MM - Two digits for the minute (preface single digit minute values with a zero - 05). SS - Two digits for the second (preface single digit second values with a zero -02).

2.0.5.c

nvreadlog
NetVault log information can be reviewed through the use of this command.
Syntax nvreadlog [-h] [-b <days>] [-d <delimiter string>] [-o <messages>]

-h: Adding this tag will exit after outputting historic logs.

Important: Since this command incorporates a -h switch, the full command -help must
be input to view additional help for this command from a terminal session prompt (e.g., nvreadlog -help). -b: This tag followed by a number value determines the number of days prior, from which a dump is to begin. -d: Adding this tag accompanied by specific character(s) alerts the interface on how to separate displayed data (e.g., -d followed by < > (two spaces) would separate each displayed item of data with two spaces). -o: Including this switch will reveal operator messages only, where the <messages> variable requires that you input the desired type of message (e.g., -o <failed> would display only operator messages that included the word failed). Multiple items can be included for this variable, separated by a comma.

66

Chapter 2 NetVault:Backup CLI Commands

2.0.6

Other Command Line Executables


This section gives a list of the remaining Command Line Executables that are available for use with NetVault.

2.0.6.a

bonedate
Use this command to obtain the BakBone time and date in use on the current machine. This value will be obtained from whichever machine is currently configured as the BakBone Time Server (for details on BakBone Time and its setting, please see the NetVault: Backup - Configurator Guide).

2.0.6.b

getmachineid
Use this command to obtain the machine identification number for the current machine (i.e., as used in obtaining license keys).

2.0.6.c 2.0.6.d

nvlicenseinfo
Use this command to obtain license information for the NetVault Server.

nvlicenseinstall
Use this command to install license for the NetVault software or the APMs/Plugins using the key file (i.e., the.npk file containing the key) or the license string.

Important: This command is not located in the ...\netvault\util directory, and can be
found in the following directory: ...\netvault\bin
Syntax nvlicenseinstall <keyfile> | <license string>

2.0.6.e

nvpassword
Use this command to change the NetVault password for the machine on which this command is run. There are no switches to be used with this command. Type the new NetVault password along with the command (after a space) to change it.

Important: This command is not located in the ...\netvault\util directory, and can be
found in the following directory: ...\netvault\bin

NetVault: Backup Command Line Interface Users Gude

67

2.0.6.f

nvpluginaccess
This script is used to enable CLI backups and the generation of CLI-based reports for APMs that require the use of database-related utility (e.g., onbar for Informix database users and rman for Oracle). The use of this CLI script is tied to specific APMs and its proper use is completely covered in the relevant APMs Users Guide.
.

Syntax nvpluginaccess [-remove -client <client names>] | [-client <client name> (-account <account name> -password < account password>)]

-client: NetVault name of the Client. -account: Name of user account to be used with this command. -password: The password associated with the user account.

Important: This script should only be utilized if directed to do so in a NetVault:Backup APM


Users Guide.

2.0.6.g

nvreport
This command allows you to utilize NetVault:Backups reporting functionality from the CLI. This tool is considerably powerful and offers a host of switches and different methods of use. For details on the use of this CLI command, please see Appendix A: Running Reports from the CLI on page 71.

2.0.6.h

nvsendmail
Use this script to send an e-mail message.
Syntax nvsendmail [-d <dest_address>] [-r <real_name] [-s <subject>] [-f <message_text>] [-a <attach_file>] [-m] [-n]

-d: The e-mail address of the intended recipient. -r: The actual name of the intended recipient. -s: The subject line of the e-mail.

68

Chapter 2 NetVault:Backup CLI Commands -f: The e-mail message to be sent. -a: If it is necessary to attach a file to the e-mail use this switch accompanied by the exact path and file name of the desired file. -m: This switch forces mime-format. -n: This switch specifies notification mode in which the necessary parameters will be taken from the host environment.

2.0.6.i

nvsendopmsg
Use this command to send an operator message.
Syntax nvsendopmsg [-n] [-test]

-n: Send notification from environment variables. -test: Send test operator message.

command line interface users guide

S E C T I O N

Appendix

2 :

command line interface users guide

Appendix A:

Running Reports from the CLI


A.0.0 - NetVault:Backup Reporting with the CLI ............................................. 73
A.0.1 - Help from the Command Line .................................................................................. 73

A.1.0 - Using nvreport to View Reports from the CLI................................ 73


A.1.1 - Classes (The -class Switch) ................................................................................. 74 - A.1.1.a - Using the -class Switch ..................................................................................... 74 - A.1.1.b - Canned Reports ................................................................................................. 74 A.1.2 - Template Files (The -templatename/-templatefile Switches) ............................... 83 - A.1.2.a - Outputting Reports Using a Template File.............................................................. 84 A.1.3 - Adjusting a Reports Layout and Content ................................................................ 87 - A.1.3.a - Pre-Requisites for Use ........................................................................................ 87 - A.1.3.b - The -format Switch ........................................................................................... 89 - A.1.3.c - The -Sort Switch ............................................................................................... 94 - A.1.3.d - Including/Excluding Data from a Report ................................................................ 95 - A.1.3.e - The -title Switch................................................................................................ 99

A.2.0 - The nvreport Command and External Reports ............................ 100


A.2.1 - Creating External Report Files from the CLI ........................................................... 100 - A.2.1.a - Phase 1: Inputting a Template-related Switch & Naming a Template File ................ 101 - A.2.1.b - Phase 2: Apply the -outputdir Switch ................................................................ 117 - A.2.1.c - Phase 3: Set Format Options for the Output Report (Optional) ............................... 121

72

Appendix A Running Reports from the CLI

NetVault: Backup Command Line Interface Users Gude

73

A.0.0

NetVault:Backup Reporting with the CLI


Probably the most versatile command line utility available for use with NetVault:Backups Command Line Interface is the nvreport command. This command allows the user to take advantage of NetVaults extensive reporting tools from the command line and display them in the terminal session window. This appendix covers the use of the nvreport command to generate reports from the command line. Where applicable, it compares the CLI reporting functionality to what is found in the GUI (i.e., it discusses how they work interactively); and it also covers in detail, the several switches offered for use with this command.

A.0.1

Help from the Command Line


Extensive help is available from the command line for this feature by typing the command followed by the -help switch (e.g., nvreport -help). As well, additional help pertaining to each of the switches associated with the nvreport command is available by entering the name of the desired switch after the -help switch (e.g., nvreport -help templatename).

A.1.0

Using nvreport to View Reports from the CLI


The nvreport command allows the powerful NetVault Reporting engine to be driven from the command line. The command reports on a specific Class of NetVault operations and uses a named Template file to format the output. The table below offers a brief description of the major switches available for use with this command.
Syntax
nvreport -server [server name] -class [classname] -templatename [template name] -or-templatefile [complete path to template file]

-server: The name of the NetVault:Backup Server that will administer the report job. With a remote instance of a Server named, that Servers NetVault Database will be analyzed for the desired report information (e.g., if a report was run regarding media usage, resulting data pertaining to media in use by that NetVault:Backup Server would be revealed in the resulting report). If the job is to be administered by a remote NetVault Server, this switch must be used to name that specific Server. If the local instance of the NetVault Server is to be used, this switch can be left out of the syntax. -class [class name] - This applies to the specific Class of NetVault functionality for which the report will gather information. Pre-created, or Canned Reports are run using this switch. A detailed explanation on this switch and its proper usage is outlined in the section, Classes (The -class Switch) on page 74.

74

Appendix A Running Reports from the CLI -templatename [template nice name]/-templatefile [complete path to template file] - This switch allows you to call out specific files that has been created to determine the content, layout and format of the report. The -templatename switch is used to call out a template file based on its nice name value as revealed in the NetVault GUI; while the -templatefile switch is used to input the exact path to, and specific file name for a template file that is to be used. A detailed explanation on these switches and their proper usage is outlined in the section, Template Files (The -templatename/ -templatefile Switches) on page 83.

A.1.1

Classes (The -class Switch)


NetVault:Backup breaks down reports into individual groups known as a Class, and each class pertains to a specific functionality set in the software. A class main purpose is to organize the individual report components, or Template Files into groups. It is these template files that are actually used to generate a report. For more information on template files, please see the section, Template Files (The templatename/-templatefile Switches) on page 83.

A.1.1.a

Using the -class Switch


The example below shows how the -class switch is used to name a specific NetVault reporting class. By naming a class in this manner, its default template file is accessed to run a canned report. For the sake of this example, the Clients class was used. nvreport -class Clients

Figure A-1: An example of the output returned for the Canned Report associated with the Clients Class

C:\Program Files\NetVault\util>nvreport -class Clients Component Clients at 11:06:53, 09 Dec 2005 Client Name NVSERVER Client1 Client 2 Type Windows Linux UNIX Status UP UP UP Server Yes No No Access Yes Yes Yes Preferred Address NVSERVER Client1 Client2 Contact Address 10.55.55.2 10.55.55.43 10.55.55.44

A.1.1.b

Canned Reports
As previously noted, each NetVault:Backup report class has a default report job that can be run in association with it. These default reports are referred to as Canned Reports. When a class name is properly called out in conjunction with the -class switch, the default template file that is associated with that class is used to run a report. For example, to run the Client Groups class canned report from the command line, the following syntax would be used: nvreport -class Client Groups

NetVault: Backup Command Line Interface Users Gude

75

Canned Report Descriptions


The table that follows offers a brief description of the canned report that will be run when its associated Class is named with the -class switch.

Important:
1. The value listed in the Class Name column of the following table is the exact value that should be used as the variable for the -class switch in order to run its associated Canned Report. If a name contains a space in its title, ensure that its full name is enclosed in quotes ( ) when input as the variable. 2. Class Names are not case-sensitive. They can be input using initial capital letters (as revealed in the following table) or all lower-case letters.
Class Name
Advanced Options

Canned Report Result


When this class is used in conjunction with the -class switch, each Advanced Options Set that has been created and saved will be displayed (in alphabetic order). Each created Advanced Options Set will be accompanied by information outlining how options are selected for the Set. When this class is used in conjunction with the -class switch, all operations attempted in NetVault by a specific user account will be displayed with their result (Yes=granted/ No=denied). In addition, the date and time each operation was attempted will be revealed. When this class is used in conjunction with the -class switch, each Backup Target Set that has been created and saved will be displayed (in alphabetic order), along with information pertaining to any Advanced Options that have been selected/de-selected for the Set. When this class is named in conjunction with the -class switch, details pertaining to the various existing Client Groups are given, including: Client Group Name Description of the Client Group All? - Labelling if all current Clients are member of this group. Members - If individual members belong to this group, they are displayed. When this Report is selected and run, the status of all Clients currently added to the NetVault Server will be displayed. Information provided includes: Added Client Name Version of NetVault Currently Installed Access - Whether or not access is currently available (yes/no). Status - Current status of the Client (up/down).

Audits

Backup Targets

Client Groups

Clients

76

Appendix A Running Reports from the CLI


Class Name
Defined Jobs

Canned Report Result


When this class is used in conjunction with the -class switch, all jobs that have been created on the NetVault Server are revealed. In addition, specific information pertaining to each job is revealed, including the following: Job ID Number Job Title Client Name - The name of the Client the job was performed. Policy - The name of the policy the job belongs to (if applicable). Plugin - The plugin (or APM) used to run the job (if applicable). Type - The job type (e.g., backup, report, etc.). SchedSetName - The name of the schedule set used (if applicable). SelSetName - The name of the Selection Set used (if applicable). btargsetname - The name of the backup Target Set used (if applicable). AOptsSetName - The name of the Advanced Options Set used (if applicable). When this class is named in conjunction with the -class switch, specific information pertaining to any events that may have occurred with drives under the control of the Netvault Server will be revealed, including the following: Time - The time the event occurred Date - The date the event occurred Drive Name - The name of the drive as reveled in NetVault Event - The type of event that occurred (e.g., start write, stop write, etc.) When this class is named in conjunction with the -class switch, information will be revealed in a table-format that offers performance statistics for all drives currently under the control of the NetVault Server. This includes the following: Time - The time at which the job accessed the drive Date - The date on which the job accessed the drive Drive Name - The name of the drive accessed drive Job Id - The NetVault identification number assigned to the specific job. Instance - The instance of the specific job (i.e., a value of 2 indicates the second time this job has been run). Rate(kb/sec) - The average rate at which NetVault transferred data to media in the named drive for the specific job.

Drive Events

Drive Performance Statistics

NetVault: Backup Command Line Interface Users Gude


Class Name
Drives

77

Canned Report Result


When this class is named in conjunction with the -class switch, information pertaining to all drives accessible to NetVault will be revealed in a table format. This includes the following: Machine - The machine to which the drive is locally attached (or, in the case of a library drive, the name of the machine the library is directly attached). Drive Name - The name of the drive as recognized by NetVault Status - The current status of the drive (online/offline). MB Read - The amount of data currently being read by the drive (0 if no jobs are active). Data Written - The amount of data written to the selected drive. Rd/Wr Errors - The number of Read/Write errors that have occurred. Written Date - The last date on which media was written to in this drive. Read Date - The last date on which media was read from in this drive. DateLastCleaned - The last date drive was cleaned. DataSinceCleaning - The amount of data written to the drive since it was last cleaned. When this class is named in conjunction with the -class switch, information will be displayed regarding the entry/exit ports that exist in any libraries currently under the control of the NetVault Server. Information specific to any media contained in an e/e port will be revealed if any of them contain media at the point in time the command is issued. When this class is named in conjunction with the -class switch, information pertaining to the completion status of all NetVault jobs will be revealed in a table, including: Start Date - The date on which the job was run Start Time - The time at which the job started Job Id - The NetVault identification number assigned to the specific job. Instance - The instance of the specific job (i.e., a value of 2 indicates the second time this job has been run). Phase - If the job was broken up into multiple phases, the number of the phase for the selected job. Job Title - The name given to the job when it was created Type - The type of job (e.g., Backup, Restore, Report) Exit Status - The status of the job once it completed (e.g., Completed, Completed with errors, Failed, etc.). Run Length - The total amount of time the job took to reach its Exit Status.

Entry/Exit Ports

Job History

78

Appendix A Running Reports from the CLI


Class Name
Libraries

Canned Report Result


When this class is named in conjunction with the -class switch, information pertaining to the any library devices currently under the control of the NetVault Server will be revealed, including: Library Name - The name generated for the library when it was added to NetVault. Product - The type of library device. Vendor - The brand of library device. LibraryModel - The library devices model number (if applicable). Library Status - The current status of the library (e.g., online/ offline). When this class is named in conjunction with the -class switch, information will be displayed regarding the drives that exist in any libraries currently under the control of the NetVault Server. Information specific to any media contained in a drive will also be revealed if any of them contain media at the point in time the command is issued. When this class is named in conjunction with the -class switch, information will be displayed regarding the slots that exist in any libraries currently under the control of the NetVault Server. Information specific to any media contained in a slot will also be revealed if they contain media at the point in time the command is issued. When this class is named in conjunction with the -class switch, information pertaining to licensing installed for the NetVault Server will be displayed. When this class is named in conjunction with the -class switch, information regarding all media currently in use by devices under the control of the NetVault Server will be revealed. This includes the following: Group - The Group Label to which the selected piece of media belongs (i.e., the media has been assigned a group label in NetVault). Label - The NetVault media label assigned Space Left - The amount of space still available for use Space Used - The amount of space on the media used by NetVault Format - The format of the piece of media (e.g., MTF=Windowsbased/UTF8=Linux/UNIX-based) Need Import - Yes indicates that the media is currently in an e/e port and needs to be imported. No indicates that the media is available in a slot/drive. Need Recovery - Yes indicates that NetVault does not recognize the format of the data currently on the media and it should be scanned (i.e., via the Scan command available in the Device Management window of the GUI). No indicates the media is recognizable to NetVault. Unusable - Whether or not the media has been marked as unusable in NetVault (e.g., Yes=Marked as Unusable/No=Not Marked) When this class is named in conjunction with the -class switch, information pertaining to the capacity of any media available in the libraries/standalone drives under the control of the NetVault Server will be displayed.

Library Drives

Library Slots

License Capabilities

Media

Media Capacities

NetVault: Backup Command Line Interface Users Gude


Class Name
Media Job Contents

79

Canned Report Result


When this class is named in conjunction with the -class switch, specific information pertaining to the NetVault backup jobs contained on available media is revealed, including: Label - The NetVault media label assigned Group - The Group Label to which the selected piece of media belongs (i.e., the media has been assigned a group label in NetVault). Barcode - The barcode value assigned to the selected piece of media housing the job Job Title - The name of the job, as set in NetVault Client Name - The name of the NetVault Client that served as the backup target. Start Date - The date on which the backup job was run Start Time - The time at which the backup job began Xfer Size - The total amount of data transferred to media for the job Expiry Date - The date on which the backup saveset created for this job is scheduled to expire. Expiry Time - The time at which the backup saveset created for this job is scheduled to expire. When this class is named in conjunction with the -class switch, information pertaining to the requests made to any media available in the libraries/standalone drives under the control of the NetVault Server will be displayed, including: Date - The date on which the media request was issued. Time - The time at which the media request was issued. Job Id - The NetVault identification number of the job that made the media request. State - The status of the request When this class is named in conjunction with the -class switch, information pertaining to backup job segments, in relation to media used by available devices will be revealed, including: Label - The NetVault media label assigned Barcode - The barcode value assigned to the selected piece of media housing the job Job Title - The name of the job, as set in NetVault Client Name - The name of the NetVault Client that served as the backup target. Backup Date - The date on which the segment of the backup job was run. Backup Time - The time at which the segment of the backup job was run Length - The file size length of this segment of the backup.

Media Requests

Media Segment Contents

80

Appendix A Running Reports from the CLI


Class Name
Media Transfer Requests

Canned Report Result


When this class is named in conjunction with the -class switch, information pertaining to the transfer requests made to any media available in the libraries/standalone drives under the control of the NetVault Server will be displayed, including: Job Id - The NetVault identification number of the job that requested transfer to the media. Instance - The instance of the Job Id that requested transfer to the media. Type - The type of transfer requested (e.g., read/write). Request Id - The identification number for the request, as assigned by NetVault. Transferred - The amount of data transferred per this request. When this class is named in conjunction with the -class switch, a table will be revealed that offers a description of all NetVault events, broken down into their respective event classes. NetVault events allow you to set up a trigger that will occur when the event happens in NetVault (e.g., an e-mail can be sent when a NetVault event occurs). Please see the NetVault: Backup - Administrators Guide for details on setting up NetVault events.

NetVault Event Types

NetVault Events

When this class is named in conjunction with the -class switch, information will be displayed, pertaining to the occurrence of various NetVault events. Information includes: Date/Time of Event Event Name Event Class - The class the selected NetVault event belongs to. Description - Brief information describing the event. Event Message - The message issued as a result of this event. When this class is used in conjunction with the -class switch, all log entries currently housed in the NetVault Database will be displayed in the terminal session window. Based on the number of log entries that exist in the NetVault Database, it may take several minutes (or longer) for this command to reveal results (i.e., the greater the number of log entries, the longer it will take to process the information and display the results). When this class is named in conjunction with the -class switch, information is displayed pertaining to how the current Global Notifications profile is set up (i.e., via the Global Notification window in the GUI). Information includes: Notify Class - The class designation of the selected global notification. Notify Event - The NetVault event that must occur in order to trigger the selected global notification method. Account Name - The name of the Access Control account to which this Global Notification profile belongs (if applicable.) Notification Method - The method of notification used for this global notification (e.g., sysop operator message, sysop e-mail, run a job, etc.).

NetVault Logs

Notifications

NetVault: Backup Command Line Interface Users Gude


Class Name
Operator Messages

81

Canned Report Result


When this class is named in conjunction with the -class switch, all outstanding operator messages (as revealed in the Operator frame of the Status window) will be displayed, comprised of their ID number, the time and date they were sent, and whether or not it has been acknowledged (e.g., represented as Outstanding? Yes=Not acknowledged/No=Acknowledged). If no operator messages appear in this frame (i.e., they have all been acknowledged and/or deleted) this report will return no information. When this class is named in conjunction with the -class switch, information pertaining to all created policies will be displayed in a table, comprised of the following columns: Policy Name - The name given for the policy in the GUI. Jobs - This will display the total number of jobs that have been created within the policy. Clients (#) - This will display total number of NetVault Clients that have been set up to run the jobs in the policy. Status - The current status of the policy (e.g., OK if all jobs in the policy have run successfully, Warnings if they completed with warnings; and Errors if errors have occurred). Clients (Names) - This will display the names of the NetVault Clients that have been set up to run the jobs in the policy. When this class is named in conjunction with the -class switch, information pertaining to the Client established for a policy will be revealed, including: Policy Name - The name given to the policy in the GUI. Client Name - The name of a NetVault Client that has been set up in the policy. Status - The current status of the policy (e.g., OK if all of the Clients in the policy are accessible; and Errors if errors have occurred). When this class is named in conjunction with the -class switch, information pertaining to the jobs set up in a policy will be revealed, including: Policy Name - The name given for the policy in the GUI. Job Name - The name of a job that has been set up in the policy. Selection Set - The name of a Backup Selection Set that was used in the creation of the job. Active - Whether or not the job is currently active and ready to be run. When this class is named in conjunction with the -class switch, a table is displayed that lists the privileges currently granted to each user account set up on the NetVault Server (i.e., for each account set up using the Access Control functionality offered in the GUI). At default, NetVault has two accounts Administrator and Default. If no other user accounts have been set up for use, these two will be all that is revealed if this report is run.

Policies

Policy Clients

Policy Jobs

Privileges

82

Appendix A Running Reports from the CLI


Class Name
Report Templates

Canned Report Result


When this variable is used in conjunction with the -class switch, all report template files that are saved in the ...\NetVault\reports\templates directory will be revealed. The following information is revealed when this Canned Report is run from the command line: Name - The file name given to the template file. Class Name - The NetVault:Backup report class to which the template file belongs Output Type - The designated output type for this templates report (e.g., Plain Text will generate a report viewable from a terminal session window, while HTML Text will generate an HTML-based report suitable for viewing in a browser application and finally a CSV Text template file will generate a comma separated report that is designed for import into, and viewing in a spreadsheet application). When this class is used in conjunction with the -class switch, each Schedule Set that has been created and saved will be displayed (in alphabetic order), along with information pertaining to any options that have been selected/de-selected for the Set. This includes all Schedule Sets -- whether created for backup or restore jobs. When this class is named in conjunction with the -class switch, information pertaining to any segments of a backup job will be revealed, including: Job Id - the identification number assigned to the backup job by NetVault Instance - The instance of the Job Id run (e.g., 8 would indicate the eighth time the job had run since its initial launch) Offset - The starting point (in bytes) on the media where the segment of the job exists Length - The overall size of the segment (in bytes) Label - The media label assigned to the piece of media on which the segment backup exists. Barcode - The barcode value assigned to the piece of media on which the segment backup exists. When this class is used in conjunction with the -class switch, each Backup Options Set that has been created and saved will be displayed (in alphabetic order), along with information pertaining to any options that have been selected/de-selected for the Set. This includes all Backup Options Sets -- regardless of the APM or Plugin used to create them.

Schedule Sets

Segments

Selection Option Sets

NetVault: Backup Command Line Interface Users Gude


Class Name
Selection Sets

83

Canned Report Result


When this class is used in conjunction with the -class switch, each Selection Set of backup/restore job data items that has been created and saved will be displayed (in alphabetic order). Name - The name of the Selection Set Selection Tree Follows... (Backup Selection Set) - A path will be revealed to the selected items, broken down as follows:

NetVault Client Name > APM/Plugin Used > Path to Data Items Selected
Selection Tree Follows... (Restore Selection Set) - A path will be revealed to the selected items, broken down as follows:

NetVault Client Name > APM/Plugin Used > Root Node Name (if app.) > Backup Saveset Name and Information > Target Restore Path
Users When this class is named in conjunction with the -class switch, information pertaining to all user accounts set up on the NetVault Server via the Access Control functionality will be revealed, including: Account Name - The name of the user account, as established during creation. Real Name - The real name value assigned to this account during its creation (if appl.). UID - The user identification number automatically assigned to this account by NetVault (values are assigned in increments of one, based on the order the account was created. Values begin at 2, in order to accommodate for the default user accounts, Default = 0 and Administrator = 1). Workstation - The O/S name assigned to the machine the account was created on (if appl.) Logon Date - The last date on which this account accessed NetVault. Logon Time - The last time at which this account accessed NetVault.

A.1.2

Template Files (The -templatename/-templatefile Switches)


As briefly noted in the previous section, NetVault:Backups Reporting utility uses a file referred to as a Template to output report data. A template is a series of individual reporting commands that have been laid out in the proper sequence, and then saved into a composite file. The template file is called out for use in generating a report, using either the -templatename or -templatefile switches. In essence, it is the template that is actually used to generate a report, and a class is simply a category of template files.

84

Appendix A Running Reports from the CLI

A.1.2.a

Outputting Reports Using a Template File


NetVault:Backup makes it possible to call out a template file to generate a report in one of two ways: Method 1: By Using the Template Files Actual File Name (Using the -templatefile Switch) - You can use the -templatefile switch in conjunction with the nvreport command to name the actual template file to be used. This switch requires that you input the exact path to, and the file name of the desired template file: nvreport -templatefile C:\netvault\reports\templates\logsclidefault

Figure A-2: An example of the output returned when a template file is run using the File Name method and the -templatefile switch

C:\NetVault\util>nvreport -templatefile C:\netvault\reports\templates\clientsclidefault Component Clients at 11:06:53, 09 Dec 2005 Client Name NVSERVER Client1 Client 2 Type Windows Linux UNIX Status UP UP UP Server Yes No No Access Yes Yes Yes Preferred Address NVSERVER Client1 Client2 Contact Address 10.55.55.2 10.55.55.43 10.55.55.44

Important:
1. The files pertaining to all report templates can be found in the following directory (i.e., where ... refers to the complete path to the installation of NetVault): ...\NetVault\reports\templates 2. If the value input for the file path contains any spaces, the entire variable must be enclosed in quotes (e.g., -templatefile C:\program files\netvault\reports\templates\clientsclidefault) Method 2: By Using the Template Files Nice Name Value (Using the -templatename Switch) - Each template file has been created with an alternate name value known as its Nice Name. This value is how the template file is revealed in the windows of the NetVault GUI (e.g., in the Reporting Job Editor window). Include this Nice Name value along with the -templatename switch in the syntax of the nvreport command: nvreport -templatename Client Machines - cli default template
Figure A-3: An example of the output returned when a template file is run using the Nice Name method and the templatename switch

C:\NetVault\util>nvreport -templatename Client Machines - cli default template Component Clients at 11:06:53, 09 Dec 2005 Client Name NVSERVER Client1 Client 2 Type Windows Linux UNIX Status UP UP UP Server Yes No No Access Yes Yes Yes Preferred Address NVSERVER Client1 Client2 Contact Address 10.55.55.2 10.55.55.43 10.55.55.44

NetVault: Backup Command Line Interface Users Gude

85

Important:
1. If any spaces exist in the Nice Name value for a template, the entire value must be enclosed in quotes ( ). 2. It is also possible to locate the Nice Name value for a template file by opening the template file in a text editing software and noting what accompanies the %NICENAME line of the file.

Best Practice - Using the -Class Switch Instead


While it is possible to use either of the aforementioned switches in conjunction with any template file, it is recommended that you use the -class switch when running a report using a template file that includes clidefault in its file name or cli default file/textual in its Nice Name. Template files named in this manner are the default canned templates that are used by their class to run a canned report,. Using the -class switch method generally requires less syntax, and as an end result, you will achieve the exact same result when the report is output. As an example, issuing any of the three commands below will result in the same report output: nvreport -class Clients nvreport -templatename Client Machines - cli default client nvreport -templatefile C:\netvault\reports\templates\clientsclidefault The following table lists the class name of the 36 available canned reports and its associated template file that is actually used to run the report -- in both its actual file name and its Nice Name value. Used properly with its associated switch, each of the three values can be used to run a canned report that will reveal the same data.
Canned Report Class Namea
Advanced Options Audits Backup Targets Client Groups Clients Defined Jobs Drive Events Drive Performance Statistics Drives

Template File Used to Generate Canned Report


GUI Nice Nameb Advanced Options - cli default template Audits - cli default template Backup Targets - cli default template Client Groups - cli default template Client Machines - cli default template Defined Jobs - cli default template Drive Events - cli default template Drive Performance Statistics - cli default template Drives - cli default template File Namec advancedoptionsclidefault auditclidefault backuptargetsclidefault groupsclidefault clientsclidefault jobdefinitionsclidefault driveeventsclidefault driveperformanceclidefault drivesclidefault

86

Appendix A Running Reports from the CLI


Canned Report Class Namea
Entry/Exit Ports Job History Libraries Library Drives Library Slots License Capabilities Media Media Capacities Media Job Contents Media Requests Media Segment Contents Media Transfer Requests NetVault Event Types NetVault Events NetVault Logs Notifications

Template File Used to Generate Canned Report


GUI Nice Nameb Entry/Exit Ports - cli default template Executed Job History - cli default template Libraries - cli default template Library Drives - cli default template Library Slots - cli default template This Server's License Capabilities - cli default template Media - cli default template File Namec entryexitportsclidefault jobhistoryclidefault librariesclidefault librarydrivesclidefault libraryslotsclidefault licensecapsclidefault mediaclidefault

Media Capacities - cli default template mediacapacitiesclidefault Media Contents Query - Textual Media Requests - cli default template mediajobcontentsclidefault mediarequestsclidefault

Media Segment Contents Query - Tex- mediasegmentcontentsclidefault tual Media Transfer Requests - cli default template mediatransfersclidefault

NetVault Event Types - cli default tem- eventtypesclidefault plate NetVault Events - cli default template NetVault Logs - cli default template User's Selected Notifications - cli default template eventsclidefault logsclidefault notificationsclidefault operatormessagesclidefault policiesclidefault policyclientsclidefault policyjobsclidefault privilegesclidefault reporttemplatesclidefault schedulesclidefault segmentsclidefault

Operator Messages Operator Messages - cli default template Policies Policy Clients Policy Jobs Privileges Report Templates Schedule Sets Segments Selection Option Sets Selection Sets Users Policies - cli default template Policy Clients - cli default template Policy Jobs - cli default template Granted Privileges - cli default template Report Templates Installed on System Schedule Sets - cli default template Segments - cli default template

Selection Option Sets - cli default tem- seloptionsclidefault plate Selection Sets - cli default template Users - cli default template selectionsclidefault usersclidefault

a. This variable is used in conjunction with the -class switch

NetVault: Backup Command Line Interface Users Gude

87

b. This variable is used in conjunction with the -templatename switch c. This variable is used in conjunction with the -templatefile switch, and it must also be accompanied by the complete path to the template file

Important:
1. For a detailed description on the data revealed for each of the above canned reports, please review the table in the section, Canned Report Descriptions on page 75. 2. NetVault offers many additional template files that are not covered in this table (i.e., there are additional template files that are not used in generating a canned report, but can be accessed for use). The sections that follow discuss the use of these templates.

A.1.3

Adjusting a Reports Layout and Content


In addition to the key switches used in conjunction with the nvreport command, several other optional switches are available that allow you to affect the layout and content of a report. The sections that follow outline the use of these switches.

Important: Unless otherwise noted, the descriptions of the switches offered in this section
assume that they are being used in conjunction with report templates that use a Plain Text output type (i.e., those with clidefault/- cli default template in their file name that are designed to be viewed from a terminal session window).

A.1.3.a

Pre-Requisites for Use


The following sections cover some basic procedures that you should follow prior to using any of the switches outlined here.

Locating a Reports Real Name Field Values


When a report is run and viewed from the CLI, data will be output in various columns and each of these columns is headed with a value referred to as a Field Name. However, the field name value may not be the same as its Real Name value set up in the template file that is used to run the report. This real name is what must be used when calling out a field in conjunction with any of the switches covered in the sections that follow. For example, when run from the CLI, the Media Requests - cli default template file will reveal four columns of information, headed with the field names, Date, Time, Job Id and State. However, the real name setting in the template file is JOBID instead of Job ID, and TRANSITION instead of State. In order to successfully use a switch along with the Job ID or State fields, they would have to be called out using their real name values (e.g., JOBID for the Job ID and TRANSITION for the State).

88

Appendix A Running Reports from the CLI


Template file content (Real Name values) Actual output in the terminal window (Field Name values)

Figure A-4: Referred to as JOBID and TRANSITION in the template file, these fields output as Job Id and Status in the resulting report in the terminal window

The Real Name values JOBID and TRANSITION must be input when used with a switch

How Real Name Values are Found These values can be found for a field in one of two ways: From the Terminal Session Prompt - To obtain a list of valid field names for a class canned report, the following command can be used: nvreport -help fields [class name] This will list all of the fields available for output with the selected class canned report. The resulting output will show four columns of information. The first is comprised of a fields real name values (i.e., how it is labeled in the template file). The second contains the field name for the column (i.e., how the same field is actually revealed when the report is run). The third names the type of data that the column will contain, and the last column gives a basic description of the data that is output.
Figure A-5: Using the help fields command to reveal both the Real Name and Field Name for a canned report

C:\NetVault\util>nvreport -help fields media requests nvreport - Copyright (c) BakBone Software Inc. 2001 There are 8 fields... Real Name Date Instance JobId RequestId Transition SessionId SysTime Time Field Name Date Instance Job Id Request Id State Session Id SysTime Time Data Type Date Integer Integer Integer String Unique System time Time Description Date of event Job instance generating event Job generating event Unique identifier of media request State of the request: Received Comp... Session generating event System internal time of event Time of Event

NetVault: Backup Command Line Interface Users Gude

89

Important: This command will display all fields available for use with the selected class
canned report, even those that are not revealed when the report is run (e.g., when the media requests canned report is run, only the Date, Time, Job ID, and State field names are revealed, but additional fields are revealed when the -help fields command is used. These fields can be applied to the report, if desired -- please see the section, The -format Switch on page 89 for details on adding more fields to a canned report). To determine the fields used by default for a selected template file, perform the following steps: 1. Run the report and note each columns default Field Name. 2. Run the nvreport -help fields [Class Name] command. 3. Locate the appropriate Field Name in the list and cross-reference its Real Name value.
Figure A-6: With a template file open for viewing, Real Name values for a field can be found in the %Format line, each prefaced with a %

View the Template File in a Text Editing Software - Once opened, the values in the %FORMAT line will reveal the Real Name value for each of the fields displayed when the template is used. These template files can be found in the following directory (i.e., where ... refers to the path to the installation of NetVault:Backup): ...\NetVault\reports\templates

Important: Only the Real Name values that apply to the fields revealed when a report is
run are shown in the %FORMAT line of a template file.

A.1.3.b

The -format Switch


By default, a report will be displayed in a pre-defined layout when run in the terminal window. The -format switch allows you to change various aspects of the report, based on what is displayed (e.g., limit the number of characters that can be displayed in a column, determine the columns that will be displayed for the report, etc.). The following points include information to be considered when using the -format switch as well as instructions on its use: A Fields Real Name, as Set in the Template File Must be Used - As explained in the section, Locating a Reports Real Name Field Values on page 87, you must have the real name value that applies to the field that is to be modified with the -format switch. All Fields Named Must be Prefaced by a Percentage (%) Symbol - For the CLI to recognize each field title, it must be prefaced with a % symbol.

Important: If a percentage symbol exists in a fields real name for a selected template, use
the escape sequence %% when inputting the name.

90

Appendix A Running Reports from the CLI When Using the -format Switch, ALL Columns Desired for Display Must be Called Out - Using the same example as a previous point, the Media Requests - cli default template template file will reveal four columns of information, Date, Time, Job Id and State. If the -format switch is used in any way, all fields desired for display in the report must be named in the switch syntax using their real name value. If any of the fields are left out, they will not be displayed in the report. This methodology can also be used if you wish to omit a column from the report, or if you wish to add additional columns of information to the report output.

Important: When naming multiple fields using the -format switch, all must be separated
by a single space and the entire set must be enclosed in quotes. For example: -format %Date %Time %JOBID %TRANSITION
Figure A-7: In this example, the -format switch was used and only three of the available four fields were named, therefore only three are revealed

C:\NetVault\util>nvreport -class media Requests -format %Date %JOBID %TRANSITION Component media requests - cli default template at 11:06:53, 09 Dec 2005 Date 29 Nov 2005 29 Nov 2005 29 Nov 2005 30 Nov 2005 30 Nov 2005 30 Nov 2005 Job Id 31 31 31 31 31 31 Status Received Started Completed Received Started Completed

Limiting the Number of Characters Displayed in a Column - The maximum number of characters to be displayed for a column can be set by appending two colons and a number value to the field name (e.g., %TRANSITION::3 will limit the display in the Status column to only the first three characters).
Figure A-8: In this example, ::3 was appended to the %TRANSITION variable in order to limit the character width in the Status column to three characters

C:\NetVault\util>nvreport -class media requests -format %Date %JOBID %TRANSITION::3 Component media requests - cli default template at 11:06:53, 09 Dec 2005 Date 29 Nov 2005 29 Nov 2005 29 Nov 2005 30 Nov 2005 30 Nov 2005 Job Id 31 31 31 31 31 Status Rec Sta Com Rec Sta

NetVault: Backup Command Line Interface Users Gude

91

Inserting a Line Break - Various reports can issue a large amount of information, that may run together and be difficult to visually separate. To include a line break between each entry in an output report, append %\n to the end of the list of field names named with the -format switch.
Figure A-9: In this example, %/n was appended to the end of the string of variables in order to insert a line break between each report entry

C:\NetVault\util>nvreport -class media Requests -format %Date %Time %JOBID %TRANSITION %\n Component media requests - cli default template at 11:06:53, 09 Dec 2005 Date Time 29 Nov 2005 23:00:01 29 Nov 2005 23:00:01 29 Nov 2005 23:05:31 Job Id 31 31 31 Status Received Started Completed

Adding Additional Information Columns (i.e., Fields) - Some template files offer several additional Field Names that can be added to a reports output, in order to include additional data. This is accomplished by using the -format switch and calling out all of the desired Field Names to be used. The example below uses the drives class canned report -- all of the default Fields offered for this report are to be used, but it is also necessary to identify the number of Write Errors that may have occurred using this drive. 1. The canned report was run to identify all existing Fields. From a terminal session prompt, the following command was issued: nvreport -class drives 2. As a result, the following Fields were revealed in the finished report, and these names were all noted: Drive Name Product Vendor Status DriveMachine Drive Data Written Drive Data Read 3. At the terminal session prompt, the following command was issued: nvreport -help fields drives 4. All of the Fields available for use with the drives class template file were revealed. At this stage two tasks were performed:

92

Appendix A Running Reports from the CLI Cross Reference Field Names with Their Real Name Values - The Field Names noted in Step 2, are located in the Field Name column (the second column), and their associated Real Name values were noted (from the first column):
Field Name
Drive Name Product Vendor Status DriveMachine Drive Data Written Drive Data Read

Real Name
DriveName Product Vendor Status: DriveMachine DriveDataWritten DriveDataRead

The Real Name Value for the Additional Column is Noted - As discussed in the introduction, we would like to add a column of information to the output that notes the quantity of write errors that may have occurred with any of the drive(s) in use by the NetVault Server. In scanning the list of available fields, Drive Write Errors is located in the Field Names column, so is associated Real Name value of DriveWriteErrors is noted. 5. At the terminal prompt, the -format switch is used in conjunction with the nvreport command, in the following format, in order to achieve the desired result: nvreport -class drives -format %DriveName %Product %Vendor %Status %DriveMachine %DriveDataWritten %DriveDataRead %DriveWriteErrors
Figure A-10: With the command properly input, an additional column of information is added to the report
C:\NetVault\util>nvreport -class drives -format %DriveName %Product %Vendor %Status %DriveMachine %DriveDataWritten %DriveDataRead %DriveWriteErrors NetVault 7.4 Server NVSERVER - Report CLI Report Component drives at 11:08:23, 09 Dec 2005 Drive Name DRIVE 1 DRIVE 2 DRIVE 3 Product EXB-480 EXB-480 EXB-480 Vendor Exabyte Exabyte Exabyte Status Online Online Offline DriveMachine NVSERVER NVSERVER NVSERVER Drive Data Written 12.4GB 9.5GB 4.4GB Drive Data Read 0B 81.9MB 103.6MB Drive Write Errors 0 0 2

The additional column appended to the end of the report output.

Important:
1. Before choosing an additional Field to be used in a reports output, please review the full list of those available for a template file (i.e., via the nvreport -help field <class name> command, review the information offered in the Description column for each Field Name/ Real Name). Ensure that the Field you include will include the desired data output.

NetVault: Backup Command Line Interface Users Gude

93

2. All of the same rules called out in the previous points in this section that describe the use of the -format switch also apply to its use when adding Fields to a reports output. 3. In instances when the drives or media classes default template files are used to add additional colums of data in this manner, it is important to note that the following apply to the use their available Real Names in the command: Reporting Read/Write Errors - As briefly pointed out in the example above, it is possible to obtain a quantity of read/write errors that have occurred in conjunction with the specific drives available to the NetVault Server. In addition, it is also possible to list the frequency of these errors in based ontheir occurrence with actual media in a library. Both of these mthods require the use of the proper class default template file, and the specific fields Real Name must be included in the syntax through the use of the -format switch: Errors Associated with Media - These errors require the use of the media class and the -format switch must contain the Real Name values, ReadErrors (Field Name = Read Errors), and/or WriteErrors (Field Name = Write Errors). Example: nvreport -class media -format <other column info> %WriteErrors Errors Associated with Drives - These errors require the use of the drives class and the format switch must contain the Real Name values, DriveReadErrors (Field Name = Drive Read Errors), and/or DriveWriteErrors (Field Name = Drive Write Errors). Example: nvreport -class drives -format %<other columns> %DriveReadErrors If the ReadErrors/WriteErrors Real Name values are used in conjunction with the drives class (i.e., instead of the intended DriveReadErrors/ DriveWriteErrors values), the report will generate read/write error information, but this information is specific to any media that currently exists in a drive -- not the entire range of drives in that device. If no media exists in the drive however, a result of UNKNOWN will be returned. 4. For ease of use, it is recommended that custom commands such as this be written to a text file and saved, or included in a script. This will eliminate the need to manually type out the command each time the report is required.

94

Appendix A Running Reports from the CLI

A.1.3.c

The -Sort Switch


Through the use of the -sort switch you can tell NetVault to sort the resulting entries in a report, based on a selected field. A sort expression must be of the the following format: -sort %[field name][+/-] [field name] - This is a variable that applies to any valid field name that will be output in the report. [+/-] - This indicates the order in which the result will sorted based on the value of the specified field (i.e., ascending if + and descending if -).

Important: A report can be sorted on any field a class offers. Even a Real name Field
Name that is not revealed in an output report can be used for ordering the output (i.e., the additional Real Names/Field Names revealed when the nvreport -help fields [class name] command is used to determine the fields that comprise a template -- as explained on page 88).
Figure A-11: In this example, the report was set up to sort based on the title of jobs, in ascending order

C:\NetVault\util>nvreport -class Job History -sort %TITLE+ Component Executed Job History - cli default template at 11:06:53, 09 Dec 2005 Start Date 29 Nov 2005 30 Nov 2005 01 Dec 2005 05 Dec 2005 28 Oct 2005 11 Nov 2005 Start 23:00:01 23:00:01 23:05:31 11:45:01 01:00:01 16:15:01 Job Id 31 31 31 33 33 32 Instance 1 2 3 1 1 1 Job Title All Full All Full All Full Inc_1 Master_D No_DB Exit Status Completed Aborted Completed Completed Aborted Complete Run Length 00:05:32 00:02:11 00:07:42 00:10:56 00:22:23 02:01:19

Additional Notes on Use


A Fields Real Name, as Set in the Template File Must be Used - As explained in the section, Locating a Reports Real Name Field Values on page 87, you must input the real name value that applies to the field that is to be sorted when employing the -sort switch. All Fields Called Out Must be Prefaced by a Percentage (%) Symbol - In order for the CLI to recognize each field, it must be prefaced with a % symbol.

Important: If a percentage symbol exists in a field title for a selected template, use the
escape sequence %% when inputting the field title.

NetVault: Backup Command Line Interface Users Gude

95

Sort Expressions can be Joined - Multiple fields can be named along with the -sort switch. The resulting report will prioritize the sort based on the order of the field names in the syntax (i.e., the first value will determine the first search priority, the second one will determine the second, etc.). When using multiple entries in this fashion, all must be enclosed in quotes ( ).
Figure A-12: In this example, the report was set up to sort based on the title of jobs, and then based on each jobs exit status, both in ascending order

C:\NetVault\util>nvreport -class Job History -sort %TITLE+ %EXITSTATUS+ Component Executed Job History - cli default template at 11:06:53, 09 Dec 2005 Start Date Start Job Id 30 Nov 2005 23:00:01 31 29 Nov 2005 23:00:01 31 01 Dec 2005 23:05:31 31 05 Dec 2005 11:45:01 33 28 Oct 2005 01:00:01 33 11 Nov 2005 16:15:01 32 Instance 2 1 3 1 1 1 Job Title All Full All Full All Full Inc_1 Master_D No_DB Type Backup Backup Backup Backup Backup Restore Exit Status Aborted Completed Completed Completed Aborted Complete Run Length 00:02:11 00:05:32 00:07:42 00:10:56 00:22:23 02:01:19

The primary sort variable - all jobs are sorted alphabetically by job title, first.

The secondary sort variable - all jobs with the same title are then sorted alphabetically based on their exit status.

A.1.3.d

Including/Excluding Data from a Report


Through input of the proper syntax, you can tell NetVault what resulting data should be displayed when a report is run (i.e., you can exclude or include specific data). To accomplish this, a filter string is input that follows this format: %[field name][operator][constant] [field name] - This is the Real Name value of the field whose data is to be affected with this command. [operator] - This can be any of the following: > (greater than) >= (greater than or equal to) < (less than) <= (less than or equal to) = (equal to) != (not equal to) [constant] - This is a value to which the [field name] value will be compared. For example, to include only entries that apply to the NetVault job assigned the Job ID of 33, you would include 33 as the [constant].

96

Appendix A Running Reports from the CLI


C:\NetVault\util>nvreport -class Job History %JOBDEFINITIONID = 33 Component Executed Job History - cli default template at 11:06:53, 09 Dec 2005 Start Date 05 Dec 2005 28 Oct 2005 Start Job Id Instance Job Title 11:45:01 33 1 Inc_1 01:00:01 33 1 Master_D Type Backup Backup Exit Status Completed Aborted Run Length 00:10:56 00:22:23

Figure A-13: In this example, the report was set up to only include entries that correspond to Job ID 33

The Job ID field has a Real Name value of JOBDEFINITIONID, in the template file, so this value is used as the [field name], followed by = as the [operator] and the desired Job ID value, 33 as the [constant]

Available Constant Types


The various constant types that can be used for comparison are given in the table that follows:
Constant Type
Amount of Time Passed (Timepassed)

Description
For fields that gather data based on a time interval that has elapsed (e.g., the amount of time it took to run a backup job). Can be input in either of the following formats: HH:MM:SS (22:10:11) - Based on a 24-hour clock HHMMSS (221011) - Based on a 24-hour clock For fields that present a final form of answer, based on the resulting data (e.g., does the named client have the Server version of NetVault installed = Yes/No; <option X> is enabled for this job = True). Examples of boolean arguments: Yes No True False This applies to a specific date a NetVault event occurred (e.g., nvreport -class job history %STARTDATE >= [Date]). This can be input in two ways: Specific Date: Input in the following formats:

Boolean Arguments (boolean)

Date

YYYY/MM/DD (2005/01/15) - Year/Month/Date YYYY/MM/DD (20050115) - YearMonthDate


Past Date: now-[number value][time variable (YE = Year, MO = Month, WE = Week, DA = Date, HO = Hour, MI = Minute, SE = Second)]. For example, now-1YE would be one year ago)

NetVault: Backup Command Line Interface Users Gude


Constant Type
Days of the Week (daysinweek)

97

Description
For fields that return a result of a day of the week. Input in the following format: [NN] - A two letter indication for each day of the week:

Sunday = SU Monday = MO Tuesday = TU Wednesday = WE Thursday = TH Friday = FR Saturday = SA


Days of the Month (daysinmonth) For fields that return a result of a specific date in the month. Input in the following format: [Day(s) of the Month] - Desired date(s). Multiple entries separated with a comma and a space, and all enclosed in quotes (e.g., 1, 2, 4, 8, 23 would include the first, second, fourth, eighth and twenty-third days in the month) For fields return a result of a total number of hours, days weeks months and years. Input in the following format: [#H] [#D] [#W] [#M] [#Y] - For example, 12H 2W 10M 18Y would be 12 hours, two weeks, 10 months, and 18 years. Each time variable can be added or omitted as required. Same as Number Value below, but for larger numeric values (e.g., 764874497498723497 - no commas needed). For fields that display a numeric value as their resulting data (e.g., nvreport -class job history %INSTANCEID = [Number Value] -- To only reveal jobs whose instance value meets what is input). 1 45 N/A N/A For fields that display a string of text as their result (e.g., the Exit Status of a NetVault job -- nvreport -class job history %EXITSTATUS!= [String of Text]). Some examples of strings that are issued and can be used as a [constant]: Failed Completed with Warnings (Strings of text with spaces must be enclosed in quotes).

Count of Hours, Days, Weeks, Months and Years (hdwmycount)

Large Number Value (Integer) Number Value (Integer)

pluginscreen selectiontree String of Text (String)

98

Appendix A Running Reports from the CLI


Constant Type
System Time (Systime)

Description
Specific time applying to a NetVault event that occurred in relation to the system time on the NetVault Server. This can be input in two ways: Specific Time: The number of seconds that have passed since midnight, on January 1st 1970: (e.g., a value of 1104537600 seconds would be midnight on January 1st, 2005, taking all leap years into account since 1970) Past Time: now-[number value][time value] (YE = Year, MO = Month, WE = Week, DA = Date, HO = Hour, MI = Minute, SE = Second -- e.g., now-30mi would be 30 hours ago) This applies to a specific time a NetVault event occurred (e.g., nvreport -class job history %STARTTIME >= [Time]). This can be input in two ways: Specific Time: Input in the following formats:

Time

HH:MM:SS (22:10:11) - Based on a 24-hour clock HHMMSS (221011) - Based on a 24-hour clock
Past Time: now-[number value][time variable (YE = Year, MO = Month, WE = Week, DA = Date, HO = Hour, MI = Minute, SE = Second)]. For example, now-12ho would be 12 hours ago. Unique Weeks of the Month (weeksinmonth) N/A For fields that return a result of a specific week in the month. Input in the following format: [Week Number] - Desired week number(s). L refers to the last week in the month (e.g., 134L would include the first, third, fourth, and last week in the month)

Additional Notes on Use


A Fields Real Name, as Set in the Template File Must be Used - As explained in the section, Locating a Reports Real Name Field Values on page 87, you must input the real name value that applies to the field whose data is to be included/excluded. All Fields Called Out Must be Prefaced by a Percentage (%) Symbol - In order for the CLI to recognize each field, it must be prefaced with a % symbol.

Important: If a percentage symbol exists in a field title for a selected template, use the
escape sequence %% when inputting the field title. Multiple Include/Exclude Arguments Can Be Linked - Through the use of boolean arguments, multiple include/exclude arguments can be applied (e.g., Boolean arguments consist of AND and OR). In addition, parenthesis can be applied to determine the priority of the boolean arguments. When using multiple entries in this fashion, all must be enclosed in quotes ( ).

NetVault: Backup Command Line Interface Users Gude


Figure A-14: An example of using multiple include/ exclude arguments in the syntax of an nvreport command

99

C:\NetVault\util>nvreport -class Job History (%JOBDEFINITIONID > 10 AND %INSTANCEID < 5) OR %TYPE = restore Component Executed Job History - cli default template at 11:06:53, 09 Dec 2005 Start Date 28-Oct-05 11-Nov-05 12-Nov-05 29-Nov-05 30-Nov-05 03-Dec-05 04-Dec-05 05-Dec-05 07-Jan-06 Start 1:00:01 16:15:01 11:04:43 23:00:01 23:00:01 23:05:31 11:45:01 11:45:01 18:32:09 Job Id 31 15 14 32 32 33 35 35 35 Instance 3 1 1 1 1 2 13 13 14 Job Title Master_D Report1 Report2 All Full All Full All Full Inc_1 Inc_1 Inc_1 Type Backup Report Report Backup Backup Restore Backup Restore Restore Exit Status Aborted Completed Completed Completed Aborted Completed Completed Completed Completed Run Length 0:22:23 0:00:03 0:00:02 0:05:32 0:02:11 0:07:42 0:09:26 0:10:56 0:14:13

The include/exclude argument given, (%JOBDEFINITIONID > 10 AND %INSTANCEID < 5) OR %TYPE = restore states that only those jobs whose Job ID is greater than 10 AND whose Instance value is less than five should be revealed in this report. In addition, all restore jobs will be displayed, regardless of their Job ID and Instance values.

A.1.3.e

The -title Switch


When a report is run and viewed from the command line, it is given the default title, Report CLI Report in the output. This switch can be used to change this title to any desired value, and is applied using the following syntax: -title <Desired Report Title>

Figure A-15: A comparison of the Media Requests canned report run with and without a title using the -title switch

The default Title for a report With the -title switch used, the output report is named accordingly

Important:
1. If a desired title is to contain any spaces, the entire value must be enclosed in quotes (as demonstrated in the example image, above).

100

Appendix A Running Reports from the CLI

2. While the -title switch can be used to label a CLI-output report, it is better suited to label a report that is output to file, and viewed outside of the CLI. For example, the -outputdir command explained on page X-REF, allows you to output a report for viewing outside of the CLI. In this case, when the -title switch is used, the desired name will appear in the saved report file.

A.2.0

The nvreport Command and External Reports


By default, a report run using the nvreport command from a terminal session window will be output in that window for viewing. However, NetVault also makes it possible to generate actual report files from the command line that are saved to an external directory. These report files can then be used as desired (e.g., they can be opened for viewing in an HTML-based browser software; they can be sent as email attachments for others to view, etc.). This is all made possible through the use of the proper switches in the nvreport command syntax.

A.2.1

Creating External Report Files from the CLI


The process used to create an external report file is generally the same as the process used to run a report and view the results in the terminal session window. Some differences in the syntax do apply, and additional switches must be applied. The sections that follow offer a step-by-step description of the syntax required for use in combination with the nvreport command. With the nvreport command input, the remaining syntax. Phase 1: Name the Template File to be Used - Through the use of the appropriate template-related switch (e.g., -templatename or -templatefile). The section, Phase 1: Inputting a Template-related Switch & Naming a Template File on page 101 describes the switches that can be used, and how they should be applied. It also offers a description of the template files that are available for use in generating an external report file. Phase 2: Apply the -outputdir Switch - This switch is used to tell NetVault to create an external version of the report. It also asks that you name a sub-directory in which the generated report file will be saved. Phase 3: Set Format Options for the Output Report (Optional) - This section discusses optional formatting switches that can be included in the syntax to customize the report file.

NetVault: Backup Command Line Interface Users Gude

101

A.2.1.a

Phase 1: Inputting a Template-related Switch & Naming a Template File


With the nvreport command input, it is first necessary to call out the template file to be used. This can be accomplished by using any of the switches discussed in earlier sections of this guide (e.g., -class, -templatefile and -templatename). However, it is recommended that only those switches described below be used to create an external report file: The -templatename Switch - Use this switch in conjunction with the Nice Name value associated with a specific template file. This value is how the template file is revealed in the windows of the NetVault GUI (e.g., in the Reporting Job Editor window). Include this Nice Name value along with the -templatename switch in the syntax of the nvreport command: The -templatefile Switch - Use this switch to input the complete path and file name for the specific template file to be used. All NetVault Report template files are housed in the following sub-directory of the NetVault installation directory (i.e., where ... refers to the complete path to the installation of NetVault): ...\NetVault\reports\templates

Important: While it is possible, it is recommended that you avoid using the -class switch to generate a report file for viewing outside of the terminal session window. The -class switch is designed to call out a default template file and create a report for viewing in the terminal session window (i.e., the report created has a default output type of Plain Text and is specifically designed for viewing from the terminal session window). You may not obtain the desired end result in an external report when the -class switch is used. Which Type of Template File Should be Used?
As discussed in previous sections of this guide, there are basically two types of report template files, based on their output format -- HTML-based template files and Plain Text-based template files. The sub-sections that follow offer a description of these two template file types and offer details on their effectiveness when used to generate an external report file. HTML-based Template Files Up until now, most sections of this guide covered the use of the 36 canned templates that have been specifically designed for output and viewing from the command line. You may have noticed that NetVault also offers 50 additional template files for use -- these additional files are used to generate HTML-based reports for viewing from the NetVault:Backup GUI. However, when used in conjunction with the -outputdir switch, you can generate an HTML-based file for the report, that can be viewed externally.

102

Appendix A Running Reports from the CLI Can They Be Used To Generate an External Report File? YES Is This Recommended? YES - This process is designed to accommodate the HTML-based template files. Files of This Type Available for Use - The table that follows offers the actual file name for each HTML-based template file, as well as its Nice Name value, and a brief description of the report that will be created when it is named in the syntax.
Template File Namea
activejobs

Nice Name Description of HTML-based Report Valueb


Currently Active Jobs When a report utilizing this component is run, summary information of all jobs that are currently running and active is displayed (e.g., Backup, Restore and Report jobs). The information includes: Job Identification Number Job Title Client Name - The name of the NetVault Client on which the active job is running. Policy Name - The name of the Policy (if applicable). Running Status - The status of the active job (e.g., Writing to Media). When a report utilizing this component is run, information pertaining to all drives accessible to the NetVault Server will be displayed. Machine - The machine the drive is attached to. Drive Name Status - Current status of the drive (online/offline). Data Read - The amount of data currently being read by the drive (0 if no jobs are active). Data Written - The amount of data written to the selected drive. Read Errors - The number of Read errors that have occurred. Write Errors - The number of Write errors that have occurred. Written Date - The last date the drive was written to. Read Date - The last date the on which the drive was read. DateLastCleaned - The last date drive was cleaned. DataSinceCleaning - The amount of data written to the drive since it was last cleaned. UseTimeSinceLastCleaning - The number of times the drive has been used since it was last cleaned.

alldrives

All Drives

NetVault: Backup Command Line Interface Users Gude


Template File Namea
allfailedpolicyjobs

103

Nice Name Description of HTML-based Report Valueb


Failed Policy Jobs When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information pertaining to the failed policy jobs within the given date range will be displayed. Information given includes: Policy Name - The name of the Policy. Client Name - The name of the machine that the failed job ran on. Job Title Plugin - The plugin (or APM) used for the job. Start Date Start Time Run Length - The amount of time the job took until it reached exit status. Exit Status - The status of the job once NetVault completed it (e.g., Backup Completed with Warnings). When a report utilizing this component is run, information pertaining to the various existing Client Groups will be given, including: Client Group Name Description of the Client Group All? - Labelling if all current Clients are member of this group. Members - If individual members belong to this group, they are displayed.

clientgroups

Client Groups

clientstatuses

Client Statuses When a report utilizing this component is run, the status of all Clients currently added to the NetVault Server will be displayed. Information provided includes: Added Client Name Version of NetVault Installed Access - Whether or not access is currently available (yes/no). Status - Current Status of the Client (up/down). Recent Error Logs When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed, pertaining to NetVault error log entries that have occurred in the date range specified. Information includes: Date/Time of Error Log Entry Client - The name of the NetVault Client that the action that generated the error log entry was running on.

errorlogs

104

Appendix A Running Reports from the CLI


Template File Namea
errorlogs (cont.)

Nice Name Description of HTML-based Report Valueb


Recent Error Logs (cont.) Job Identification Number Instance Number Message - The message given as a result of the error log entry. Warn Level - The level associated with the selected error log entry (e.g., error, completed with warnings, etc.). When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed, pertaining to the occurrence of various NetVault events. Information includes: Date/Time of Event Event Name Event Class - The class the selected NetVault event belongs to. Description - Brief information describing the event. Event Message - The message issued as a result of this event.

events

NetVault Events

expiredofflinemedia Expired Offline When a report utilizing this component is run, inforMedia mation will be displayed pertaining to any expired offline media. Information displayed includes: Media Label - The label given to the piece of media that is currently offline/expired. Media Group - The name of the media group that the target piece of media belongs to (if applicable). Barcode - The barcode assigned to the target piece of media. Date Written/Read - The last date the target media was written to/read from. Offsite Location - The specified offsite location for the target media (if applicable). failedrequests Failed ULA Requests When a report utilizing this component is run, all attempted operations in NetVault that resulted in failure as a result of their access level will be revealed with their end result (Yes = granted/No = denied), sorted by the various user accounts. When this component is run, information will be displayed pertaining to any online media that is currently full. Information displayed includes: Media Label - The label given to the piece of media that is currently online and full.

fullonlinemedia

Full Online Media

NetVault: Backup Command Line Interface Users Gude


Template File Namea
fullonlinemedia (cont.)

105

Nice Name Description of HTML-based Report Valueb


Full Online Media (cont.) Media Group - The name of the media group that the target piece of media belongs to (if applicable). Barcode - The barcode assigned to the target piece of media. Date Written/Read - The last date the target media was written to/read from. Media Expiry Date - The scheduled expiry date for the target media (if applicable). LibraryName - The name of the library that the target media currently resides in (if applicable). Logical Slot Position - The number designation for the logical slot the target media resides in (if applicable). Offsite Location - The specified offsite location for the target media (if applicable). Need Import - Whether or not an Import needs to be performed on the target piece of media. When a report utilizing this component is run, information is displayed pertaining to the various set Global Notifications. Information includes: Notify Class - The class designation of the selected global notification. Environment - The configured notification environment (if applicable). Notify Event - The NetVault event that must occur in order to trigger the selected global notification method. Notification Method - The method of notification used for this global notification (e.g., sysop operator message, sysop e-mail, run a job, etc.). When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed, pertaining to past backup/restore jobs that occurred within this date range, sorted by the data size of the job (the largest job appearing first). Information column include: Start Time/Date Run Length

globalnotifications

Global Notifications

historicjobs

Historic Jobs By Date

106

Appendix A Running Reports from the CLI


Template File Namea
historicjobsbysize

Nice Name Description of HTML-based Report Valueb


Historic Jobs By Size When this component is run, it is prefaced by a filter dialog box requesting a date range. Once given, information will be displayed, pertaining to past backup/restore jobs that occurred within this date range, sorted by the date the job took place (the most recent job appearing first). Information columns include: Job Title Job Identification Number Instance Number Client Name - The name of the machine the job was run from. SelSetName - The name of the Backup/Restore Selection Set used (if applicable). Backup Size - The overall size of the backup (backup jobs only). Exit Status - The status of the job once NetVault completed it. Start Time/Date Run Length When a report utilizing this component is run, information pertaining to all jobs that have been created in NetVault and saved, but not necessarily run is given (i.e., Backup, Restore and Report Jobs). Information includes: Job ID Number Job Title Client Name - The name of the Client the job was performed. Policy - The name of the policy the job belongs to (if applicable). Plugin - The plugin (or APM) used to run the job (if applicable). Type - The job type (e.g., backup, report, etc.). SchedSetName - The name of the schedule set used (if applicable). SelSetName - The name of the Selection Set used (if applicable). btargsetname - The name of the backup Target Set used (if applicable). AOptsSetName - The name of the Advanced Options Set used (if applicable).

jobdefinitions

Defined Jobs

NetVault: Backup Command Line Interface Users Gude


Template File Namea
jobhistory

107

Nice Name Description of HTML-based Report Valueb


Executed Job History When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information pertaining to all NetVault jobs (e.g. Backup, Restore and Report jobs) will be displayed. The following information is included: Job Identification Number Job Title Client Name - The name of the machine the job was run from. Exit Status - The status of the job once NetVault completed it. Plugin - The plugin (or APM) used for the job (if applicable). Type - The type of job (Backup, Restore, Report). Start Date/Time End Date/Time Run Length Blank Media Items in LibrariesWhen a report utilizing this component is run, the number of blank media items residing in the libraries under control of the current NetVault Server will be displayed. Library Name - The name of the library where the blank media is residing. Blank Media Count - The total blank media items available in the library. When this component is run, information will be revealed pertaining to the media contents of any libraries currently added to the NetVault Server. Information includes: LibraryName - The name of the library where the target piece of media resides. DriveName - The name of the drive containing the target piece of media. Logical Slot Position - The numbered slot designation pertaining to the slot containing the target piece of media (if applicable). Media Label - The label given to the target piece of media. Barcode - The barcode assigned to the target piece of media. Media Group - The name of the media group that the target piece of media belongs to (if applicable). Space Used/Left - The amount of space used and currently remaining on the piece of media.

libraryblankcounts

Blank Media Items In Libraries

librarycontents

Libraries' Media Contents

108

Appendix A Running Reports from the CLI


Template File Namea
logs

Nice Name Description of HTML-based Report Valueb


NetVault Logs When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed, pertaining to NetVault log entries that have occurred in the date range specified. Information includes: Job Identification Number - For the log entry (if applicable). Class - The entrys designated class. Warn Level - The level associated with the selected log entry (e.g., background, error, information, etc.). Time/Date of Log Entry Client - The name of the NetVault Client that the action that generated the log entry was running on. Message - The message given as a result of the log entry (if applicable). When run, a filter window requesting various information will launch. At default, a wildcard value is input in each field which represents all qualifying values (*). With desired values input for each field and the report run, detailed information pertaining to media contents will be displayed. Information includes: Media Label - The label given to the target piece of media. Media Group - The name of the media group that the target piece of media belongs to (if applicable). Barcode - The barcode assigned to the target piece of media. Job Title - The name of the job contained in the target piece of media. Client Name - The name of the NetVault Client from which the job was performed. Plugin - The plugin (or APM) used to generate the jobs data. Start Date/Time Backup Type Backup Size Media Expiry Date/Time - The scheduled expiry date and time for the target media (if applicable).

mediacontentsquery

Media Contents Query

NetVault: Backup Command Line Interface Users Gude


Template File Namea
mediageneral

109

Nice Name Description of HTML-based Report Valueb


Media General When a report utilizing this component is run, general information will be revealed pertaining to all media accessible to the NetVault Server. Information includes: Media Label - The label given to the piece of media that is currently offline/expired. Barcode - The barcode assigned to the target piece of media. Media Type - The designated type of the target media (tape, disk file, etc.). Format - MTF for Windows based O/Ss, CPIO for UNIX. Machine - The machine that controls the device where the target piece of media resides. Media Expiry Date - The scheduled expiry date for the target media (if applicable). Offsite Location - The specified offsite location for the target media (if applicable). SpaceUsed/Left - The amount of space used and currently remaining on the target piece of media. Unusable - Whether the target piece of media is marked for re-use (Yes = not marked/No = marked for re-use). Read Only - Whether the target piece of media has been marked as Read Only (Yes = True/No = False). When this Report is selected and run, information pertaining to media segment contents is given. Information includes: Media Label - The label given to the target piece of media. Barcode - The barcode assigned to the target piece of media. Job Title - The name of the job contained in the target segment. Client Name - The name of the NetVault Client from which the job was performed. Plugin - The plugin (or APM) used to generate the jobs data. Backup Date Backup Time Length - The length of the segment in number of bytes.

mediasegmentcontentsquery

Media Segment Contents Query

110

Appendix A Running Reports from the CLI


Template File Namea
mediautilization

Nice Name Description of HTML-based Report Valueb


Media Utilization When a report utilizing this component is run, information will be revealed pertaining to use of all media accessible to the NetVault Server. Information includes: Media Label - The label given to the target piece of media. Barcode - The barcode assigned to the target piece of media. Media Group - The name of the media group that the target piece of media belongs to (if applicable). SpaceUsed/Left - The amount of space used and currently remaining on the target piece of media. When a report utilizing this component is run, information pertaining to any user-defined event type is given, including: Event Name - The name of the user defined event. Description - The description, as created by the user, of this event.

notifications

Users' Selected Notifications

offlinedevices

Offline Devices When a report utilizing this component is run, information pertaining to any currently offline drives will be displayed. When a report utilizing this component is run, information pertaining to all outstanding operator messages (as revealed in the Operator frame of the Status window) will be displayed. If no operator messages appear in this frame (i.e., they have all been acknowledged and/or deleted) this report will return no information. Date/Time - The date and time the operator message was issued. Text - The operator message text. When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range. Once properly given, information pertaining to any overnight backup jobs that failed within that date range will be displayed. Information given includes: Job Identification Number Job Title Client Name - The name of the machine that the failed job ran on. Policy Name - The name of the Policy that the failed job belongs to (if applicable). Exit Status - The status of the job once NetVault completed it

outstandingopmsgs Outstanding Operator Messages

overnight_jobs_ failed

Failed Overnight Backup Jobs

NetVault: Backup Command Line Interface Users Gude


Template File Namea
overnight_jobs_ failed_count

111

Nice Name Description of HTML-based Report Valueb


Count Of Failed Overnight Backup Jobs Count Of Successful Overnight Backup Jobs Count of Data Stored In Overnight Jobs Count Of Overnight Backup Jobs Finished With Warnings Policy Basics When a report utilizing this component is run, a single line of text is created, giving an overall total count of the overnight backup jobs that finished with warnings (e.g., 1 backup job finished with warnings). When a report utilizing this component is run, a single line of text is created, giving an overall total count of the overnight backup jobs that finished successfully (e.g., 12 backup jobs finished successfully). When a report utilizing this component is run, a single line of text is created, giving an overall total count of the data stored in overnight jobs (e.g., Approx. 348GB of data was stored). When a report utilizing this component is run, a single line of text is created, giving an overall total count of the overnight failed backup jobs (e.g., 0 backup jobs failed). When a report utilizing this component is run, basic information pertaining to all policies existing on the NetVault Server will be displayed. Information includes: Policy Name Clients Count - The number of NetVault Clients administered by the selected policy. Job Count - The number of NetVault jobs contained in the selected policy. Status - The current status of the policy, in regards to its associated jobs and their completion state. Clients - The name(s) of NetVault Client(s) administered by the selected policy. Failure Event - Failures that have occurred in relation to jobs in the selected policy. Warn Event - Warnings that have been issued in relation to jobs in the selected policy. When a report utilizing this component is run, summary information for all restore jobs performed via the current NetVault Server are displayed. Start Date/Time Client Name - The name of the machine that data was restored to. Job Title Job Identification Number Instance Number Run Length Exit Status - The status of the job once NetVault completed it.

overnight_jobs_ successful_count

overnight_jobs_ total_data_stored

overnight_jobs_ warnings_count

policiessummary

restoresummary

Restore Summary

112

Appendix A Running Reports from the CLI


Template File Namea
serverlicensecapabilities

Nice Name Description of HTML-based Report Valueb


Server License When a report utilizing this component is run, sumCapabilities mary information is displayed pertaining to the capacAnd Usage ity of the license for the current NetVault Server. Information includes: Description - A description of the various capacities of a NetVault Server license (e.g., number of Clients allowed, largest media capacity supported, number of library units, etc.). Licensed - The level/number allowed for the selected capacity (e.g., a specific number, unlimited, etc.). Used - The number actually used in reference to the number allowed in the Licensed column. Server License When a report utilizing this component is run, a table Flags of data is created giving Yes/No values for the various license-specific functions of NetVault. These values indicate whether or not the current Server license allows for this functionality. Single Job's Drive Events When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a specific jobs Job Identification and Instance numbers. Once properly given, information pertaining to transfer rates associated with the drive(s) used in this specific job will be displayed. When this component is run, it is prefaced by a filter dialog box requesting specific Job ID and Instance numbers. Once properly given, log entry information will be displayed, pertaining to the NetVault Job specified. Information includes: Date/Time of Log Entry Class - The entrys designated class. Warn Level - The level associated with the selected log entry (e.g., background, information, etc.). Client - The name of the NetVault Client that the action that generated the log entry was running on. Message - The message given as a result of the log entry (if applicable). When this component is run, a filter dialog box will launch requesting specific Job ID and Instance numbers. Once properly given, detailed information pertaining to media usage by this specific NetVault Job will be displayed. Information includes: Barcode - The barcode assigned to the target piece of media. Media Label - The label given to the target piece of media.

serverlicenseflags

single_job_drives_ events

single_job_logs

Single Job's Logs

single_job_media

Media Used by Single Backup

NetVault: Backup Command Line Interface Users Gude


Template File Namea Nice Name Description of HTML-based Report Valueb

113

Media Type - Designated type of target media (tape, disk file, etc.). Offsite Location - The specified offsite location for the target media (if applicable). single_job_media_ transfers Single Job's Media Transfers When this component is run, it is prefaced by a filter dialog box requesting specific Job ID and Instance numbers. Once properly given, information pertaining to media transfers by this specific NetVault Job will be displayed. Information includes: Received Date/Time - The date and time the media transfer request was received. Started Date/Time - The date and time the requested media transfer began. Done Date/Time - The date and time the requested media transfer completed. Type - The type of media transfer (e.g., write). Transferred - The amount of data transferred.

single_job_ summary

Single Job When a report utilizing this component is run, it is Main Summary prefaced by a filter dialog box requesting specific Job ID and Instance numbers. Once properly given, detailed information pertaining to this specific NetVault Job will be displayed. This component can be used for any NetVault job. The following information is included: Job Identification Number Job Title Type - Job type (Backup/Restore/Report) Plugin - The plugin (or APM) used for the job (if applicable). Instance Number Start Date/Time End Date/Time Exit Status - The status of the job once NetVault completed it. Transfer Size - The size of data transferred. Transfer Rate - The average amount of data transferred per second during the job (applies only to backup jobs). Single Job's Data Transfer Rate When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a specific jobs Job Identification and Instance numbers. Once properly given, information pertaining to events associated with the drives used in this specific job will be displayed. The following columns are given: Date/Time of Event Drive Name - Name of the drive in question. Event - Event(s) occurred with the selected drive for the specified job.

single_job_xfer_ rates

114

Appendix A Running Reports from the CLI


Template File Namea
singlepolicybytecounts

Nice Name Description of HTML-based Report Valueb


Policy Totals When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a specific Policys name as well as a time frame. Once properly given, information will be displayed, pertaining to the backup size and transfer rate of jobs in the named Policy that ran in the time frame specified. The following information is included: Backup Size - Total Backup Size - Average Transfer/Second - Total Transfer/Second - Average When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a specific Policys name. Once properly given, information will be displayed, pertaining to the Clients administered by the named Policy. The following information is included: Client Name - The name of the NetVault Client administered by the named policy. Policy Name - The specified policy. Status - The current status of the NetVault Client. When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a date range and Policy name. Once properly given, information pertaining to the failed jobs within the given policy and date range will be displayed. Information given includes: Policy Name - The name of the Policy. Client Name - The name of the machine that the failed job ran on. Job Title Plugin - The plugin (or APM) used for the job. Start Date Start Time Run Length - The amount of time the job took until it reached exit status. Exit Status - The status of the job once NetVault completed it (e.g., Backup Completed with Warnings). When a report utilizing this component is run, it is prefaced by a filter dialog box requesting a specific Policys name. Once properly given, information will be displayed, pertaining to the given Policy job. Information includes: Job Name Policy Name

singlepolicyclients

Policy Clients

singlepolicyfailedjobs

Failed Jobs Within Single Policy

singlepolicyjobs

Defined Policy Jobs

NetVault: Backup Command Line Interface Users Gude


Template File Namea
singlepolicyjobs (cont.)

115

Nice Name Description of HTML-based Report Valueb


Defined Policy Jobs (cont.) Job Active - Whether the job is active (Yes/No). Selection Set - The name of the Selection Set used in the Policy job. Selection Options - The name of the Backup Options Set used in the Policy job. Schedule Set - The name of the Schedule Set used in the Policy job. Target Set - The name of the Target Set used in the Policy job. Advanced Options Set - The name of the Advanced Options Set used in the Policy job. When this component is run, it is prefaced by a filter dialog box requesting specific Policys name. Once properly given, information will be displayed, pertaining to the status of the named Policy. The following information is included: Policy Name Clients Count - The number of NetVault Clients administered by the selected policy. Job Count - The number of NetVault jobs contained in the selected policy. Failure Event - Failures that have occurred in relation to jobs in the selected policy. Warning Event - Warnings that have been issued in relation to jobs in the selected policy. Status - The current status of the policy. Prefaced by a filter dialog box requesting User Account information, a report utilizing this component will give success/failure information in regards to that specific users attempts at various operations in NetVault. When a report utilizing this component is run, information is displayed pertaining to the set Global Notifications for the currently logged in NetVault user. Information includes: Notify Class - The class designation of the selected global notification. Notify Event - The NetVault event that must occur in order to trigger the selected global notification method. Real Name - The real name value associated with the current account. Notification Method - The method of notification used for this global notification (e.g., sysop operator message, sysop e-mail, run a job, etc.). Environment - The configured notification environment (if applicable).

singlepolicystatus

Policy Status Information

singleusersaudittrail

Single User's Audit Trail

userdefinedeventtypes

User-Defined Event Types

116

Appendix A Running Reports from the CLI


Template File Namea
userdetails

Nice Name Description of HTML-based Report Valueb


User Details When a report utilizing this component is run, information pertaining to all user accounts created on the selected NetVault Server will be displayed. Information includes: Account Name Real Name Description Location E-mail 1/Telephone/Cellular/Fax/Pager - Each as input in the tab of the Access Control window for the selected user account. Last Logon Date/Time Local Access Only - Whether access is limited to local.

userprivileges

User Privileges When a report utilizing this component is run, information is revealed pertaining to each NetVault User Account and its set privileges in NetVault. Information includes: Account Name - The name of the NetVault User Account. Privileges - All privileges currently allowed for the selected User Account. Quotas And Media Usage When this component is run, information is revealed pertaining to each NetVault User Accounts current settings in regards to media quotas and usage. Information includes: Account Name - The name of the NetVault User Account. Media Quota - Level set for media usage for the current user account (e.g., 100 GB, Unlimited, etc.). Media Used - The amount of media currently in use by the selected user account.

usersmediausage

a. This file name is used in conjunction with the -templatefile switch to run a report. When used, the complete path and file name must be included in the syntax. In addition, each file name displayed is to be input as a single word. b. The Nice Name value is used in conjunction with the -templatename switch to run a report. It is also how the template file (i.e., Report Component) is named in the Report Component Editor window of the NetVault:Backup GUI.

NetVault: Backup Command Line Interface Users Gude Plain Text Template Files

117

This applies to the 36 canned template files that were created for viewing in the terminal session window (i.e., all of those templates that contain the text clidefault in their file name, or cli default file/textual in its Nice Name. If a template file of this format type is called out in this syntax, and external file will be created that is comprised of simple plain text. Can They Be Used To Generate an External Report File? YES Is This Template File Type Recommended? NO - The actual formatting set up in this type of template file is specifically designed for viewing its output in a terminal session window. An external file generated using this type of template file will result in a series of plain text characters, and formatting is lost.

Important:
1. For a listing of these template files, please consult the column entitled Template File Used to Generate Canned Report in the table in the section, Best Practice - Using the -Class Switch Instead on page 85. This column will reveal both the actual template file name and its Nice Name value. 2. Plain-text format template files can be incorporated into an external report file when using the -appendoutput switch in order to add their content to an existing HTML-based report. In doing so, the report data will appear in an existing report file, in its intended Plaintext format, beneath existing HTML-data (i.e., the resulting output will maintain its expected formatting and appear in the report file as if it were output for viewing in a terminal session window). For more details on the use of the -appendoutput switch and an example of this output, please see the section, The -appendoutput Switch on page 121.

A.2.1.b

Phase 2: Apply the -outputdir Switch


With the desired template file properly input using the appropriate template switch, it is next necessary to input the -outputdir switch to tell NetVault to generate an external report file. This switch must be accompanied by a variable value that will serve as a name for the sub-directory that NetVault will create to house the completed report file. This sub-directory, once created, will exist in the ...\NetVault\reports\output directory. The syntax required for use with this switch is as follows: -outputdir <desired name for sub-directory> Below, an example of the syntax at this phase of the process is revealed in which the template file to be used is called out using its Nice Name value (i.e., the -templatename switch is used), and the report file is to be created and saved in a sub-directory entitled client_report: nvreport -templatename Client Statuses -outputdir client_report

118

Appendix A Running Reports from the CLI

Figure A-16: An example of the process used in a Windowsbased environment to generate an external report file for viewing outside of the terminal session window

An HTML-based template file is called out and the -outputdir switch is applied, with client_report set as its variable...

As a result, a new subdirectory entitled, client_report is created in the ...\netvault \reports \output directory... This new subdirectory contains an HTML file that can be opened for viewing the resulting report outside the terminal session window

Additional Notes on Use


The points below illustrate issues that should be noted when using the -outputdir switch: Existing Sub-directories Will be Overwritten when Named with the -outputdir Switch - If the variable given for the -outputdir switch is the name of a sub-directory that already exists in the .../reports/output/ reports directory, that sub-directory will be overwritten as well as all of its existing contents. An example of this issue is outlined in the points below: Phase 1: The following syntax is input to generate a report: nvreport -templatename Client Groups -outputdir report Result: The command will create the sub-directory, report and save a report file here, named output.html. Phase 2: The following syntax is used to generate a different report: nvreport -templatename Defined Jobs -outputdir report Result: The original report sub-directory will actually be removed and a new sub-directory, named report will be created, with a newly generated version of the output.html file within (i.e., the original report file will be overwritten).

NetVault: Backup Command Line Interface Users Gude

119

Important: To avoid the loss of an existing report file, perform one of the following:
Create a New Sub-directory - Input a new variable with the -outputdir switch, in order to have NetVault create a new sub-directory to house the report file(s). Append Report Data to the Existing Report File - Through the use of the -appendoutput command, you can name the same sub-directory and have NetVault append new report data to the existing report file (please see the description of this switch in the section, The -appendoutput Switch on page 121). HTML-based Template Files will Automatically Copy All Support Files to the New Sub-directory - NetVaults default HTML-based report templates contain various artwork files in their layout. When an HTMLbased report template is used, these artwork files will be automatically copied to the newly created sub-directory.

Viewing Report Files Created with the -outputdir Switch


Once a report file is generated with this switch, it can be viewed outside the terminal session window. The sections that follow offer suggestions on how to access the created files for viewing, based on their output type. Viewing HTML-format Reports To view an HTML-format report file that was generated using the -outputdir switch, either of the following methods can be used: Navigate to the .../netvault/reports/output/<named directory> and Execute the File - Manually navigate to the sub-directory that was created, and launch the file. Note the Full Path Value Given (Including File Name) as a Result of this Command, and Input it in a Browser Software - Most browser softwares offer a form of Address field that allows you to input a path to a desired destination. In this case, simply input the full path to the output.html file that was created as a result of this command.

Important: Based on the O/S in use, if a space exists anywhere in the characters that make up the path to the desired file, it may be necessary to compensate for it by inputting the proper character string to emulate a space (e.g., ASCII characters).

120

Appendix A Running Reports from the CLI

Figure A-17: An example of this process in a Mac OS Xbased environment

NetVault: Backup Command Line Interface Users Gude

121

A.2.1.c

Phase 3: Set Format Options for the Output Report (Optional)


This section illustrates the use of several optional switches that can be used in conjunction with the -outputdir switch when creating an external report file.

The -appendoutput Switch


As noted in the previous section, if an existing sub-directory is named in the syntax of the -outputdir switch, its contents will be overwritten when a new report is run (i.e., the named sub-directory is removed and replaced, with new report files). In order to maintain the contents in an existing report file, the appendoutput switch can be used. When added to the syntax, new report data will be generated and added to the existing report file.
Figure A-18: When the -appendoutput switch is properly used, new report data is added to an existing output.html file

Original report generated, using the -outputdir switch

New report data added as a result of the -appendoutput switch

Additional Notes on Use The points below illustrate issues that should be noted when using the -appendoutput switch: The -appendoutput Switch Must Be Used with the -outputdir Switch - This switch only applies when used in conjunction with the -outputdir switch. In addition, the sub-directory named as the variable with the -outputdir switch must already exist (i.e., a previous report job must have been created using the -outputdir switch).

122

Appendix A Running Reports from the CLI Different Template Files Can be Combined - If desired, a template file that is different from the original can be used and its resulting report data will be appended to the bottom of the original report file.

Figure A-19: Template files with different output formats can be combined into the same report file when using the -appendoutput switch

Original report generated, using the -outputdir switch

New report data, generated using a different template along with the -appendoutput switch

Template Output Types can be Combined - Any template file can be named and the -appendoutput switch can be used. For example, even if the original report file utilized an HTML-format of output, a Plain-Text format template can be named in conjunction with the -appendoutput switch. As an end result, report data will be appended to the bottom of the existing report file in the named templates output format.
Figure A-20: Template files with different output formats can be combined into the same report file when using the -appendoutput switch

Original report generated, using the -outputdir switch

New report data, generated using a template with a different output type, added as a result of the -appendoutput switch

NetVault: Backup Command Line Interface Users Gude

123

The -title Switch


This switch is briefly discussed in the section, The -title Switch on page 99, where its use with Plain Text-based reports output in a terminal session window is explained. While it can be used in this way, the -title switchs main purpose is to be used in conjunction with the -outputdir switch in order to affect the name assigned to a report saved for external viewing. This switch is applied using the following syntax: -title <Desired Report Title>
Figure A-21: In this example, the title switch is used to name the report Client Status, and once the report is generated, this title is revealed in the header for the report

Additional Notes on Use The points below illustrate issues that should be noted when using the -title switch: Usable with Any Format Template File - This switch can be used in conjunction with the -outputdir switch to add a title to any format of template (i.e., HTML or Plain Text-based). Only Applies to New Report Data - When used in conjunction with the -appendoutput switch, the value set as the variable with the -title switch will be used as the title of the report that is appended to the existing output.html file (i.e., the existing report will maintain its existing title).

Vous aimerez peut-être aussi