You are on page 1of 170

NetVault: Backup

version 8.5.2

Command Line Interface Reference Guide


Version: Product Number: NVG-105-8.5-EN-02

NVG-102-8.5.2-EN-02 08/23/10

Copyrights
NetVault: Backup CLI Reference Guide Software Copyright 2010 BakBone Software Documentation Copyright 2010BakBone Software 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 CLI Reference Guide 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 NONINFRINGEMENT. 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. 1999-2010 BakBone, BakBone Software, NetVault, Application Plugin Module, BakBone logo, Integrated Data Protection, SmartDisk, Asempra, and FASTRecover are all trademarks or registered trademarks of BakBone Software, Inc., in the United States and/or in other countries. All other brands, products or service names are or may be trademarks, registered trademarks or service marks of, and used to identify, products or services of their respective owners.

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

Table of Contents
Chapter 1: Introducing NetVault: Backup

NetVault: Backup At a Glance ...................................................................................... 7 Key Benefits ...................................................................................................................... 8 Feature Summary ............................................................................................................. 9 About this Document ....................................................................................................... 9 Target Audience ................................................................................................................ 9 Recommended Additional Reading .............................................................................. 10 Technical Support ........................................................................................................... 10 Documentation Updates ................................................................................................. 10

Chapter 2: Getting Started

11

NVBU Command Line Interface An Overview ........................................................... 13


- CLI Help ......................................................................................................................................... 13 - CLI Access Control ........................................................................................................................ 13

Working with Command Line Executables .................................................................. 14


Preparing to Run Command Line Executables .............................................................................. 14 Command Syntax .......................................................................................................................... 14 The nvsetmodify.cfg File .............................................................................................................. 18 Starting and/or Stopping NVBU from the CLI ................................................................................ 19

Chapter 3: Using NVBU CLI Commands


-

21

Using Command Line Executables ............................................................................... 23


Client Specific Command Line Executables .................................................................................. 23 Device Specific Command Line Executables ................................................................................ 27 Media Specific Command Line Executables .................................................................................. 42 Job Specific Command Line Executables ...................................................................................... 56 NVBU Logs Command Line Executables ...................................................................................... 92 Other Command Line Executables ................................................................................................ 95

Table of Contents

Appendix
Appendix A: Running Reports from the CLI 103

NVBU Reporting with the CLI .......................................................................................105


- CLI Help ....................................................................................................................................... 105

Using nvreport to View Reports from the CLI .........................................................105


- Report Classes ............................................................................................................................ 106 - Template File Switches ................................................................................................................ 116 - Adjusting Report Layout and Content .......................................................................................... 120

External Reports ............................................................................................................133


- Creating External Report Files ..................................................................................................... 133

Appendix B: Debugging Errors Generated by NVDB Checker 161


Debugging Errors Generated by NVDB Checker .......................................................163
- Errors Generated by nvmeddbcheck ........................................................................................... 163 - Errors Generated by nvscheddbcheck ......................................................................................... 166

Chapter 1:

Introducing NetVault: Backup


1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 NetVault: Backup At a Glance ................................................................... 7 Key Benefits ........................................................................................................... 8 Feature Summary ................................................................................................ 9 About this Document ......................................................................................... 9 Target Audience ................................................................................................... 9 Recommended Additional Reading .......................................................... 10 Technical Support ............................................................................................. 10 Documentation Updates ................................................................................ 10

Chapter 1 Introducing NetVault: Backup

NetVault: Backup Command Line Interface Reference Gude

1.1.0

NetVault: Backup At a Glance


With NetVault: Backup (NVBU), you can take advantage of the power of simplicity because having less time wrapped up in backup and recovery processes creates more time for more interesting and strategic initiatives. For example, with the NetVault: Backup Application Plugin Modules (APMs) you are not required to script backup and recovery jobs, so you do not need to understand storage, database or email internals. You select the backup strategy that best fits your database or email environment, and then just point and click. The same holds true for virtualization protection no scripting required. NVBU protects data and applications from a common, user friendly console. Plus, its ease of use makes it simpler for a new person step in to assume data protection responsibilities. NVBU is enterprise level software that does not require you to be an expert because it installs out of the box, but has the flexibility to tune it as you want. Every organization changes all the time, so BakBone engineered NVBU to keep up with those changes and let you make choices that are best for your company. For example, if an organizational merger takes place or a key department acquires a major application that requires a different platform, that is no problem with NVBUs heterogeneous server and extensive application support. The freedom of choice continues with BakBones disk-based data protection product, NetVault: SmartDisk (NVSD) and its deduplication option which provides seamless integration with NVBU to allow you to be in control of which data should be deduplicated and which should not without restricting you to specific types of storage drives and appliances. Additionally, administrators have increased choice including the ability to copy or move data between NVSD Instances, to Virtual Tape Library (VTL) or tape based devices in order to place redundant backups at offsite locations for failover and disaster recovery purposes. You can select your backup device of choice from a very large list of supported Network Attached Storage (NAS), VTL and tape systems. You decide when and where to encrypt to reduce backup windows while still meeting regulatory requirements. You can deploy and protect physical or virtual machines. With the APMs, you easily select the best backup method to protect all the popular operating systems, messaging and database applications. NVBU SmartClient gives you the freedom to attach virtual and physical tape devices where you want to. Budgets are not unlimited and are shrinking in many cases, so NVBU was architected to protect and leverage existing investments in data protection while making necessary changes and upgrades to support the growth and health of your organization. NVBUs ability to efficiently scale from small installations to very large global companies means you would not be penalized by being forced to rip and replace your data protection infrastructure just because your organization is successful and growing. The NVSD product integrates with NVBU to shrink backup windows and reduce storage costs with its post-process deduplication option which can be scheduled outside the backup window. Your investment in

Chapter 1 Introducing NetVault: Backup storage systems is protected through automated access to hundreds of different storage devices. You avoid vendor lock-in by taking advantage of NVBUs heterogeneous server support as well as powerful messaging, database and virtualization protection options. With NVBU, you protect your vital IT assets because you can still recover your data even in a worst case scenario in which you only have your backup media, but no NVBU database. Plus, you can redeploy into a different operating system for an emergency recovery.

1.2.0

Key Benefits

Power of Simplicity It is critical to an organizations success that all employees work together to meet its strategic initiatives. To ensure success, all employees must have time to work on these strategic initiatives. NVBUs power of simplicity frees your time by enabling you to protect your data without requiring you to understand the inner workings of storage, databases and e-mail applications. NVBU provides enterprise-level functionality in an easy-to-use-and-deploy solution. You can protect platforms, applications and technologies with the same solution, to save you valuable time and resources.

Enhanced Administrator Productivity Your organizations world changes all the time, so we engineered NVBU to work within your environment and not force you to modify your platform, application, or storage to fit NVBU. We give you the widest range of supported storage devices with the flexibility to adjust to ever-changing conditions.

Safeguards Your Investment NVBU protection easily scales from a single server to Fortune 500 environments without having to rip and replace your data protection solution as your organization grows. You also will not have to rip and replace NVBU if you change strategic directions with regards to platforms, databases, applications, or storage devices. NVBUs seamless integration with NVSD protects your storage investment with a powerful deduplication option that does not require you to buy specific drives or appliances. NVBU also provides very flexible disaster recovery options to protect your entire datacenter for business continuity.

NetVault: Backup Command Line Interface Reference Gude

1.3.0

Feature Summary

Heterogeneous Server Support Application Protection for Most Popular Database and Messaging Systems Virtualization Protection for VMware and Hyper-V Physical and Virtual Protection from Single Console Disk-based Data Protection Hardware Agnostic, Byte-Level Variable Block-Based Software Deduplication Job-level Deduplication Job-level Encryption Workstation Protection Easy-to-Navigate Console Network Attached Storage Integration Extensive Storage Device Coverage Automated Device Discovery and Configuration Reporting Scalability Extensive Event Notification Dynamically Shared Devices SmartClient User Level Access Policy Management Job Management

1.4.0

About this Document


This guide provides a detailed description of the command line utilities. For details on using NVBU Console, refer to the NetVault: Backup Administrators Guide.

1.5.0

Target Audience
This guide is intended for Backup Administrators and other technical personnel who are responsible for designing and implementing a backup strategy for the organization. A good understanding of the operating systems under which the NVBU Server and Clients are running is assumed.

10

Chapter 1 Introducing NetVault: Backup

1.6.0

Recommended Additional Reading


NetVault: Backup Installation Guide This guide provides complete details on installing the NetVault: Backup Server and Client software. NetVault: Backup Administrators Guide This guide describes how to use NetVault: Backup and provides comprehensive information on all NetVault: Backup features and functionality. NetVault: Backup Configuration Guide This guide explains how to configure the default settings for NetVault: Backup. NetVault: Backup Workstation Client Administrators Guide This guide provides complete information on administering the NetVault: Backup Workstation Client software. NetVault: Backup Workstation Client Users Guide This guide provides complete information on using the NetVault: Backup Workstation Client software. http://www.bakbone.com/documentation

You can download these guides from the BakBone website at:

1.7.0

Technical Support
BakBone Software is dedicated to providing friendly, expert advice to NetVault customers. Our highly trained professionals are available to answer your questions, offer solutions to your problems and generally help you make the most of your NetVault purchase. Log on to our Web site for more information: http://www.bakbone.com/supportportal

1.8.0

Documentation Updates
For the latest documentation updates, refer to the BakBone Software Knowledge Base. BakBone's Knowledge Base article for NetVault: Backup v8.5.2 can be found at the following link: http://kb.bakbone.com/5742

Chapter 2:

Getting Started
2.1.0 - NVBU Command Line Interface An Overview.................................. 13
2.1.1 - CLI Help ................................................................................................................... 13 2.1.2 - CLI Access Control .................................................................................................. 13

2.2.0 - Working with Command Line Executables ........................................... 14


2.2.1 - Preparing to Run Command Line Executables .......................................................... 14 2.2.2 - Command Syntax ..................................................................................................... 14 - 2.2.2.a - Switch Abbreviation ............................................................................................. 15 - 2.2.2.b - NVBU Names ..................................................................................................... 15 - 2.2.2.c - Using Spaces in CLI Variables .............................................................................. 16 - 2.2.2.d - NVBU Environmental Variables............................................................................. 16 - 2.2.2.e - Command Exit Statuses ....................................................................................... 18 2.2.3 - The nvsetmodify.cfg File ....................................................................................... 18 2.2.4 - Starting and/or Stopping NVBU from the CLI ............................................................ 19

12

Chapter 2 Getting Started

NetVault: Backup Command Line Interface Reference Gude

13

2.1.0

NVBU Command Line Interface An Overview


NVBU provides a utility known as the Command Line Interface (CLI), which allows you to control various functions from a terminal session using predefined executables. With proper syntax, these executables are capable of performing such NVBU operations as:

Starting or Stopping a Job Creating and Submitting jobs - This includes creating, editing, and submitting backup and restore jobs for any NVBU Client controlled by the NVBU 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 NVBU Jobs. View the Latest Operator Messages - To determine if attention is required.

2.1.1

CLI Help
To access the help notes on commands, input the desired command followed by the switch -help or --help. Simply typing the command (that is, 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

2.1.2

CLI Access Control


The Access Control feature allows an administrator to limit the level of access each user has to NVBU functionality. It can also be used with the CLI. For example, if an administrator has blocked a specific user from blanking media in the NVBU Console, the same user can also be blocked from issuing CLI commands for blanking media. You can also restrict a user from using the CLI functionality. For complete details on allowing or denying access to functions in NVBU, refer to the NetVault: Backup Administrators Guide.

14

Chapter 2 Getting Started

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 (for example, 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.

2.2.0

Working with Command Line Executables


The sections that follow offer a general description of how NVBUs CLI is used and any pre-requisite steps that should be performed. BakBone recommends that you fully review this section of the guide before attempting to use any of the CLI commands. All NVBU 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 NVBU stopping. To use the CLI commands, you must be logged on with Administrator privileges on Windows-based systems and root privileges on UNIX/Linux-based systems.

2.2.1

Preparing to Run Command Line Executables


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

2.2.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 (for example, If an NVBU Server was named Server1, input servername <server name> as servername Server1). Switches enclosed in [ ] are optional.

NetVault: Backup Command Line Interface Reference Gude

15

A | symbol between two switches indicates that only one of the multiple listed can be used in a command.

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.

2.2.2.a

Switch Abbreviation
Switches can be specified using only initial letter in their name, provided this letter is unique (that is, 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

<NVBU 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 NVBU password for the specified Server. -wait: This switch can be added to tell NVBU 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

2.2.2.b

NVBU Names
Conflicts will arise when an NVBU Server/Client or added backup device is named using an underscore character (_) and it is referenced in an NVBU 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 NVBU_Server is included in a CLI command, NVBU will search

16

Chapter 2 Getting Started for a machine named NVBU 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 include underscores must be enclosed in quotes when input in the CLI.

2.2.2.c

Using Spaces in CLI Variables


Various CLI commands require that you input a variable when you use them (for example, 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

2.2.2.d

NVBU Environmental Variables


Various switches used with commands in the CLI require that additional information be provided (that is, variable(s) must be provided). In certain circumstances, the following NVBU environmental variables can be used in place of variable information, when applicable:

NETVAULTCLIACCOUNT - Used to name an Account with access to use the CLI if it has been protected with NVBU User Level Access restrictions. This environmental variable is included in the syntax of a script along with the desired account name. NETVAULTCLIACCOUNT=<Account Name> NETVAULTCLIPASSWORD - Used to name the Password associated with the Account. This environmental variable is included in the syntax of a script along with the desired password value. NETVAULTCLIPASSWORD=<Password> NV_HOME - This variable is used to call out the path to the root of the NVBU installation directory in a script (for example, C:\Program Files\BakBone Software\NetVault Backup\ for a default installation of NVBU on a Windows-based system). This variable is used as a standalone entry in the syntax of a script, in order to call out this path. NV_JOBCLIENT - This variable is used to call out the NVBU Machine Name of a target Client from which a job was run (that is, it pertains to the specific

NetVault: Backup Command Line Interface Reference Gude

17

NVBU Client that an instance of a job targeted). This is a set value established by NVBU for the Client, and it is not user-defined. For example, a target Client exists in the NVBU Domain with an NVBU name of Client1. To successfully use this variable in a script to call out this client, you would input the following: NV_JOBCLIENT=Client1

NV_JOBID - This variable is used to call out an NVBU job based on its predefined NVBU job identification number (that is, each instance of an NVBU job is automatically given its own unique Job ID number). This identification value is specifically assigned by NVBU, and it is not userdefined. For example, a backup job has been run, and NVBU has automatically generated a Job ID value of 31. Therefore, to successfully use this variable in a script to call out this specific job, you would input the following: NV_JOBID=31 NV_JOBTITLE - This variable is used to call out a job based on its specific NVBU job title (the title given to the job in the Job Title field in the NVBU Console). When a job title is named in conjunction with this variable, you must include the specific title that was established at job run-time (that is, it is not user-defined during creation of the script). For example, a backup job has been run, and it was given the job title, Backup_Full_1. Therefore, to successfully use this variable in a script to call out this specific job, you would input the following: NV_JOBTITLE=Backup_Full_1 NV_JOB_WARNINGS This variable indicates whether a job had warnings during its previous phases. It returns TRUE or FALSE. This variable can only be used in a post script. It is currently used by mail scripts but has general applicability. NV_SERVERNAME - This variable is used to name the NVBU Server from which a command containing this variable was issued. This is the specific NVBU Machine Name value for the desired NVBU Server. For example, the NVBU Server in the NVBU Domain has been established with an NVBU name of NVSERVER. To successfully use this variable in a script to call out this Server, you would input the following: NV_SERVERNAME=NVSERVER NV_SESSIONID - This variable is used to call out an NVBU job, based on its internal session identification number as assigned by NVBU after it has launched (that is, a specific Session ID is assigned to an NVBU job after it has launched). This is a unique value specifically established by NVBU (that is, it would not be user-defined when generating a script with this variable). For example, a job has been launched and NVBU has defined a Session ID

18

Chapter 2 Getting Started for the job of 7. Therefore, this variable would be used as follows in a script, to call out this job: NV_SESSIONID=7

NV_STATUS - This represents the exit status of any previous phase of the NVBU job and will be either SUCCEEDED or FAILED (if a backup job were to complete successfully, a script using NV_STATUS would return a result of SUCCEEDED). This script is only valid when used in a Post Script.

Important: It is important to note that the return value for this script is not localized (that is, it will always be in English as SUCCEEDED or FAILED).

NV_USER_ARG - Arguments that have been passed on to the script.

2.2.2.e

Command Exit Statuses


Various NVBU CLI commands will offer a numeric result once they are executed. This number represents the actual exit status of the command (that is, 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 (for example, a variable named in the command is inaccurate).

2.2.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 NVBU functionality, each of which is accompanied by a numeric value. This number value can be used to identify its associated functionality in the CLI (that is, 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 NVBU): ...\config 2. Locate the file entitled, nvsetmodify.cfg and open it for viewing. Various NVBU functionality will be listed with an accompanying number value. 3. Note the values for the desired functionality and close this file, without saving it.

NetVault: Backup Command Line Interface Reference Gude

19

Important:
1. Ensure that the nvsetmodify.cfg is not edited or modified in any manner. BakBone recommends that you print out this file and use this print for reference purposes. 2. This functionality is intended only for highly-experienced users. Therefore, BakBone strongly recommends 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.

2.2.4

Starting and/or Stopping NVBU from the CLI


To start/stop NVBU from the command line, you can use the following commands:

Linux/UNIX Platform # $NV_HOME/etc/startup.sh { start | stop } Windows Platform C:\ net start/stop NetVault Process Manager

20

Chapter 2 Getting Started

Chapter 3:

Using NVBU CLI Commands


3.1.0 - Using Command Line Executables ........................................................... 23
3.1.1 - Client Specific Command Line Executables .............................................................. 23 - 3.1.1.a - nvclient .............................................................................................................. 23 - 3.1.1.b - nvclientaccess .................................................................................................... 25 - 3.1.1.c - nvclientadd ......................................................................................................... 25 - 3.1.1.d - nvclientlist .......................................................................................................... 26 - 3.1.1.e - nvclientname ...................................................................................................... 27 - 3.1.1.f - nvclientremove .................................................................................................... 27 3.1.2 - Device Specific Command Line Executables ............................................................ 27 - 3.1.2.a - asf_load_media................................................................................................... 27 - 3.1.2.b - asf_ release_drive ............................................................................................... 28 - 3.1.2.c - nvacslsmedia ...................................................................................................... 29 - 3.1.2.d - nvcheckdrive ...................................................................................................... 30 - 3.1.2.e - nvcleandrive ....................................................................................................... 31 - 3.1.2.f - nvclosedoor ......................................................................................................... 31 - 3.1.2.g - nvcloseeeport ..................................................................................................... 33 - 3.1.2.h - nvcloseeeportcleaning ......................................................................................... 33 - 3.1.2.i - nvdevice .............................................................................................................. 34 - 3.1.2.j - nvdeviceeject ....................................................................................................... 35 - 3.1.2.k - nvexportmedia .................................................................................................... 35 - 3.1.2.l - nvlibrarymodify ..................................................................................................... 36 - 3.1.2.m - nvopendoor ....................................................................................................... 37 - 3.1.2.n - nvopeneeport...................................................................................................... 37 - 3.1.2.o - nvresetdrivestats ................................................................................................. 38 - 3.1.2.p - nvsetcleaninglives ............................................................................................... 39 - 3.1.2.q - nvsetdrivecleaning............................................................................................... 40 - 3.1.2.r - nvsmartdisk ......................................................................................................... 41 3.1.3 - Media Specific Command Line Executables.............................................................. 42 - 3.1.3.a - nvblankmedia ..................................................................................................... 42 - 3.1.3.b - nvbulkblankmedia ............................................................................................... 44 - 3.1.3.c - nvlabelmedia ...................................................................................................... 45 - 3.1.3.d - nvlistblankmedia ................................................................................................. 47 - 3.1.3.e - nvmakemedia ..................................................................................................... 48 - 3.1.3.f - nvmediadetails ..................................................................................................... 52 - 3.1.3.g - nvremovemedia .................................................................................................. 53 - 3.1.3.h - nvreusemedia ..................................................................................................... 53

22

Chapter 3 Using NVBU CLI Commands

- 3.1.3.i - nvscanmedia ....................................................................................................... 54 - 3.1.3.j - nvsyncronizesilomedia ......................................................................................... 55 - 3.1.3.k - nvupdateserialnumber ......................................................................................... 55 3.1.4 - Job Specific Command Line Executables ................................................................ 56 - 3.1.4.a - nvexpiresaveset ................................................................................................. 56 - 3.1.4.b - nvjobabort .......................................................................................................... 56 - 3.1.4.c - nvjobcreate ........................................................................................................ 57 - 3.1.4.d - nvjobdelete ........................................................................................................ 60 - 3.1.4.e - nvjobhold ........................................................................................................... 62 - 3.1.4.f - nvjoblist .............................................................................................................. 63 - 3.1.4.g - nvjobmodify........................................................................................................ 64 - 3.1.4.h - nvjobresume ...................................................................................................... 66 - 3.1.4.i - nvjobstart ............................................................................................................ 67 - 3.1.4.j - nvpolicy .............................................................................................................. 67 - 3.1.4.k - nvrestore............................................................................................................ 69 - 3.1.4.l - nvsetcreate ......................................................................................................... 76 - 3.1.4.m - nvsetdelete ....................................................................................................... 85 - 3.1.4.n - nvsetexport ........................................................................................................ 85 - 3.1.4.o - nvsetimport ........................................................................................................ 86 - 3.1.4.p - nvsetmodify........................................................................................................ 87 - 3.1.4.q - nvtrigger ............................................................................................................ 91 3.1.5 - NVBU Logs Command Line Executables .................................................................. 92 - 3.1.5.a - nvlogdump ......................................................................................................... 92 - 3.1.5.b - nvlogpurge ......................................................................................................... 93 - 3.1.5.c - nvreadlog ........................................................................................................... 94 3.1.6 - Other Command Line Executables ........................................................................... 95 - 3.1.6.a - bonedate ........................................................................................................... 95 - 3.1.6.b - getmachineid...................................................................................................... 95 - 3.1.6.c - installplugin ........................................................................................................ 95 - 3.1.6.d - licenseinstall....................................................................................................... 95 - 3.1.6.e - nvlicenseinfo ...................................................................................................... 96 - 3.1.6.f - nvmeddbcheck .................................................................................................... 96 - 3.1.6.g - nvpassword........................................................................................................ 97 - 3.1.6.h - nvpluginaccess ................................................................................................... 97 - 3.1.6.i - nvreport .............................................................................................................. 97 - 3.1.6.j - nvscheddbcheck .................................................................................................. 97 - 3.1.6.k - nvsendmail ......................................................................................................... 98 - 3.1.6.l - nvsendopmsg ...................................................................................................... 99 - 3.1.6.m - nvsvtlgrow ......................................................................................................... 99

NetVault: Backup Command Line Interface Reference Gude

23

3.1.0

Using Command Line Executables


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

Important: The commands covered for use in this guide are the only ones that are
supported for use with NVBU. Any commands found in the ...\util directory (or other NVBU 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).

3.1.1

Client Specific Command Line Executables


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

3.1.1.a

nvclient
Use this command to add NVBU Heterogeneous and Workstation Clients to the NVBU Server. This utility allows you to add several NVBU Clients in a single command, and add them to multiple Client Groups.
Syntax nvclient [-add] [-list] [-password <password>] [-file <Client List File>] [-workstation | -client <Client Name> ...] [-group <Client Group Name> ...] [-log <Log File>] [-failure <File Name to Log Failed Clients List>] [-quiet] [-verbose] [-abort] [-args] [-timeout <timeout>]

-add: Use this switch to add NVBU Clients. -list: Use this switch to list current NVBU Clients. -password: Accompany this switch with the NVBU password for the Client.

24

Chapter 3 Using NVBU CLI Commands

-file: Accompany this switch with the name of the file containing a list of Clients, Client Groups and Passwords to enable batch submission. For example, -file clientlst specifies a file clientlst which contains the following: client1 -workstation client2 -password <password> -group <groupname> where <password> indicates the password and <groupname> indicates the group for client2.

Important: Client names are case sensitive when added from the command line or via the
-file switch.

-workstation: Accompany this switch with the names of the NVBU Workstation Client(s) that are to be added -client: Accompany this switch with the names of the NVBU Heterogeneous Client(s) that are to be added. -group: Accompany this switch with the names of the Client Group to which the NVBU Clients are to be added. -log: Accompany this switch with the name of the log file to which you want to send the log messages generated during the command execution. -failure: Accompany this switch with the name of the log file to which you want to send the Failed Clients List. -quiet: Use this switch to prevent display of output messages on the screen. -verbose: Use this switch to display detailed progress reporting and the status and error messages for all client requests on the screen. -abort: Use this switch to abort the command if sufficient licenses are not available to accommodate the entire client list. -args: Use to switch to print program parameters and exit without doing anything. -timeout: Use this switch to specify a timeout value for Client response. The timeout value is specified in seconds. nvclient [-password <password>] [-group <groupname>] [-file <clientlistfile>] | [-workstation | -client <clientname>]

Syntax Usage

NetVault: Backup Command Line Interface Reference Gude

25

3.1.1.b

nvclientaccess
Use this command to grant access to a Client machine.
Syntax nvclientaccess [-client <client name>] | [-clients <client name>] | [-tdclients <DBSname>] [-password <password>]

-client/-clients Accompany this switch with the NVBU name of the Client to grant access to it. -tdclients This switch is used exclusively for NVBU Clients with the Teradata Database software installed. Accompany this switch with the Teradata DBS name to grant access to all the added Clients. -password Use this switch to provide the NVBU password for the Client for which security has been enabled.

3.1.1.c

nvclientadd
Use this command to add an NVBU Heterogeneous Client to the Server. This command only works if issued from the NVBU Server itself. The nvclientadd utility cannot be used to add NVBU Workstation Clients. Instead of nvclientadd, use the nvclient utility in order to add multiple Workstation and Heterogeneous Clients in a single command.
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 NVBU before it can be added to an NVBU 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. A description of this command is provided on on page 26.

26

Chapter 3 Using NVBU CLI Commands


-client: Accompany this switch with the NVBU Machine Name of the Heterogeneous Client to be added to the Server. -clientip: Accompany this switch with the IP address of the machine to be added as NVBU 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. NVBU
will not automatically create a Client Group if this switch is used. Client Groups must be created in the NVBU Console (that is, no CLI utility is offered for the creation of a Client Group).

-password: If NVBU 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 NVBU 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 NVBU distribution installed on the target Client.

3.1.1.d

nvclientlist
Use this command for the following:

To get a list of Clients added to the NVBU Domain. To get a list of available NVBU Clients. To find an NVBU machine using its resolvable name or IP address.

Syntax nvclientlist [-current [-name <client name>]] [-available [-name <client name>]] [-find <resolvable name or IP address>] [-version]

-current: This switch gives a list of Clients added to the NVBU Domain. -available: This switch gives a list of available NVBU machines that can be added as Clients to the Server. -name: Accompany this switch with the NVBU Machine Name of the Client to be located. -find: Accompany this switch with the resolvable name or IP address of the machine to be located.

NetVault: Backup Command Line Interface Reference Gude

27

-version: This switch gives the build date of the NVBU distribution installed on the target Client.

3.1.1.e

nvclientname
Use this command to rename an NVBU Client. It cannot be used to change the name of an NVBU Server.
Syntax nvclientname

-clientname <new NVBU name for the client>

-clientname: Accompany this switch with the new NVBU name for the client.

3.1.1.f

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

-client: The NVBU Machine Name of the Client to be removed from the Domain.

Important: The -client switch may only be used once per use of this command (that is,
it is not possible to remove multiple NVBU Clients with a single use of the nvclientremove command).

-version: This switch gives the build date of the NVBU distribution installed on the target Client.

3.1.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.

3.1.2.a

asf_load_media
This command loads the specified media into the drive and locks it in the drive as Windows Advanced System Formate (ASF) media.

28

Chapter 3 Using NVBU CLI Commands


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 NVBU Machine Name to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. -c: The NVBU Machine Name of the Heterogeneous Client the device is attached to. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward.

3.1.2.b

asf_ release_drive
This command releases the lock previously placed on the specified device by the asf_load_media command and allows the drive and the media to be used by NVBU.
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 NVBU Server to which the device is locally attached (that is, in the event that the device is locally attached to the NVBU Server). -c: The NVBU Machine Name of the Heterogeneous Client to which the device is attached (that is, in the event the device is configured as an NVBU SmartClient). This switch is also used to name a remote NVBU Server that has the target device locally attached.

NetVault: Backup Command Line Interface Reference Gude

29

3.1.2.c

nvacslsmedia
Use this command to allocate/de-allocate media to an ACSLS library, or eject a media.
Syntax nvacslsmedia [-allocate | -deallocate | -eject] [-medialabel <media label>] [-cap <acs>,<lsm>,<cap>] -libraryname <library name> [-servername <server name>] [-range <range-media >] [-file <filename >] [-version]

-allocate: Allocates the specified media. -deallocate: De-allocates the specified media. -eject: Eject the specified media, through the specified CAP. -cap: The CAP (Cartridge Access Port) through which to eject the media. To specify the CAP, provide the ACS number of the library, LSM number of the robotic unit that controls the library and the physical number of the CAP. Separate the numeric values using comma-delimiter. For example -cap 0,0,0. -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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -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.

30

Chapter 3 Using NVBU CLI Commands

-version: This switch gives the build date of the NVBU distribution.

3.1.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 offline for some reason. If successful, the specified drive will be returned to online status so that it is available to NVBU for future jobs.
Syntax nvcheckdrive -servername <server name> [-drivename <drive name>] [-libraryname <library name>] [-drivenumber <drive number>]

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -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 NVBU 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 an NVBU Client named NVCLIENT1

NetVault: Backup Command Line Interface Reference Gude nvcheckdrive -servername NVCLIENT1 -libraryname NVLibrary -drivename Drive 1

31

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

3.1.2.e

nvcleandrive
Use this command to clean the library drive. If the number of cleaning lives has been set for the cleaning tape, 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 number of the target 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

3.1.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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive.

32

Chapter 3 Using NVBU CLI Commands

-libraryname: The name of the target library.

NetVault: Backup Command Line Interface Reference Gude

33

3.1.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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: The name of the target library. -mediatype: The type of media in the entry/exit slot.

3.1.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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: The name of the target library. -mediatype: The type of media in the entry/exit slot.

34

Chapter 3 Using NVBU CLI Commands

3.1.2.i

nvdevice
Use this command to perform the following tasks:

Check drive Clean drive Eject media Bring a drive online Make a drive offline

Syntax nvdevice

-check -clean -eject -online -offline

[-library <library name>] -drive <drive number>

-check: This switch can be used to check the status of the specified drive. For example, it can be used to check the status of a drive that was taken offline for some reason. If successful, the specified drive will be returned to online status so that it is available to NVBU for future jobs. Use the [-library <library name>] -drive <drive number> switches to specify the target drive. -clean: This switch can be used to send a request for cleaning of the specified drive. If the number of cleaning lives has been set for the cleaning tape, it will be reduced by one when used for this process. Use the [-library <library name>] -drive <drive number> switches to specify the target drive. -eject: Use this command to remove any media from a specified standalone drive. Use the -drive <drive number> switch to specify the target drive. -online: Use this switch to bring a drive online. Use the [-library <library name>] -drive <drive number> switches to specify the target drive. -offline: Use this switch to make a drive offline. Use the [-library <library name>] -drive <drive number> switches to specify the target drive. -library <library name>: The name of the target library. -drive: The number of the target drive in the library or the standalone drive.

NetVault: Backup Command Line Interface Reference Gude

35

3.1.2.j

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]

-devicename: The name of the target device or library. -servername: The NVBU Server to which the device is added. When you run this command on the NVBU Server, this switch can be omitted. The Server name is case sensitive. -librarydrivenumber: The number of the target drive in the library. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward.

Important:
1. It is necessary to use the -librarydrivenumber switch to specify the desired drive if the devicename option is used to denote a library. 2. The device names can be ascertained by inspecting the logs for the backup job.

3.1.2.k

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

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -barcode: This switch followed by the barcode number of the desired media.

36

Chapter 3 Using NVBU CLI Commands

-medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If a media label contains spaces, enclose it within quotes ( ). For example, 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 (::). Use this switch only when searching by library slot. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward.

3.1.2.l

nvlibrarymodify
Use this command to modify an existing library. The commands remove, online, offline, map or unmap can be performed on drives that exist on the specified library.
Syntax nvlibrarymodify -libraryname <library_name> [-remove DRIVE <drive_number> ] [-map DRIVE <drive_number> <lsm>,<panel>,<drive> [-name <name>] ] [-unmap DRIVE <drive_number> ] [-online "DRIVE <drive_number>] [ -offline "DRIVE <drive_number>" ] [ -servername <server_name> ]

-libraryname: The name of the target library that is to be modified. This is a mandatory parameter. -remove: Use this switch to remove a drive. The target drive is specified using the DRIVE <drive_number> argument. -map: Use this switch to map a drive to the appropriate LSM, Panel and Drive. The target drive is specified using the DRIVE <drive_number> argument. The optional -name parameter can be used to specify a user defined drive name. For example -name ACSLS_Drive-1. -unmap: Use this switch to unmap a drive. The target drive is specified using the DRIVE <drive_number> argument. -online: Use this switch to make a drive online. The target drive is specified using the DRIVE <drive_number> argument. -offline: Use this switch to make a drive offline. The target drive is specified using the DRIVE <drive_number> argument. -servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If

NetVault: Backup Command Line Interface Reference Gude

37

the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive.

3.1.2.m

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: The name of the target library.

3.1.2.n

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: The name of the target library.

38

Chapter 3 Using NVBU CLI Commands

3.1.2.o

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -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 statistics for a standalone drive named Stndalone1 that is locally attached to the NVBU 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

NetVault: Backup Command Line Interface Reference Gude NVLibrary that is locally attached to an NVBU Client named NVCLIENT1 nvresetdrivestats -servername NVCLIENT1 -libraryname NVLibrary -drivename Drive 1 -action clean

39

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 NVBU Server, with the NVBU name NVSERVER2 nvresetdrivestats -servername NVSERVER2 -libraryname NVLib2 -drivenumber 2 -action all

3.1.2.p

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 [-servername <server name>] -libraryname <library name> [-slotnumber <slot number>] [-lives <lives>]

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -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 NVBU Server named 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

40

Chapter 3 Using NVBU CLI Commands

3.1.2.q

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 be 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 100000

NetVault: Backup Command Line Interface Reference Gude

41

3.1.2.r

nvsmartdisk
Use this command to add or remove NetVault: SmartDisk (NVSD) Device.
Syntax nvsmartdisk --add --host <Host name or IP Address> [--port <port number>] [--server <server name>] [--force] --remove --device <name>

--add --host <name> [--force] [--port <number>] [--server <name>] --remove --device <name> [--force] [--server <name>]

--add: Use this switch to add an NVSD Device. --host: Accompany this switch with the DNS name or IP address of the host on which the NVSD Instance is installed. Use this switch with -add. --port: Use this optional switch to specify the port for communicating with the NVSD Instance. It is only required if NVSD is configured to use a non-default port. --server: NVBU Server to which you want to add the NVSD Instance as an NVSD Device. This switch is not required if you are running the command on the NVBU Server. --remove: Use this switch to remove the NVSD Device. --device: Accompany this switch with NVSD Device name as shown in the NVBU Console, CLI and reports. Use this switch with -remove. --force: Use this switch to do the following:

Forcefully add the NVSD Device to an NVBU Server when it is already added to another NVBU Server with the same device name. This can be useful if an NVBU Server has been re-built. Forcefully remove NVSD from an NVBU Server even when the NVSD Device cannot be contacted or some other errors block the removal.

42

Chapter 3 Using NVBU CLI Commands

3.1.3

Media Specific Command Line Executables


This section gives a list of available Command Line Executables that can be used in regards to the tape-based media being used by NVBU.

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 a media label contains spaces, enclose it within quotes ( ). For example, my media 1. 3. Various operating systems do not support the use of special characters when included in a medias label (for example, :, !, @, #, $, %, ^, &, *, (, ), >, <, \, [, ], {, }, , 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 be managed from the NVBU Console (that is, in the Media Management or Device Management windows).

3.1.3.a

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

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: Name of the target library that contains the media item to be blanked. -barcode: This switch followed by the barcode number of the desired media. -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If a media label contains spaces, enclose it within quotes ( ). For example, my media 1. If the media label

NetVault: Backup Command Line Interface Reference Gude

43

is not unique for media in all available devices, then this switch must be accompanied with either the -libraryname switch or the -drivename switch.

-slotspec: This switch followed by the library and slot number of the desired media (use only when searching by library slot). -drivename: Name of standalone drive that contains the media item to be blanked. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward.

Important:
1. In NVBU terms, blanking media removes the NVBU header information from the media. This makes the media available to NVBU for storing future backups. The backup data residing on the media is not deleted or erased; it can still be recovered from tape using OS tools or data recovery service. If it is desired to purposely destroy the data that is stored on the media, the media should be blanked by NVBU and have its data securely removed by tools that are designed for such purposes. 2. When an incorrect library/media pair is selected, NVBU will display the following error message: "Blank request failed! - 'Unable to identify media'"

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 an NVBU Client named NVCLIENT1. nvblankmedia -servername NVCLIENT1 -slotspec 21::NV_Library_Large In the example syntax below, an individual piece of media labeled DB-Backup in the library Lib-2 will be blanked. This library is connected to an NVBU Client named NVCLIENT2. nvblankmedia -libraryname "NVCLIENT2: Lib-2" -medialabel "DB-Backup"

44

Chapter 3 Using NVBU CLI Commands

3.1.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 NVBU Administrator password be input, which must be specified with this switch. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward.

Important:
1. In NVBU terms, blanking media removes the NVBU header information from the media. This makes the media available to NVBU for storing future backups. The backup data residing on the media is not deleted or erased; it can still be recovered from tape using OS tools or data recovery service. If it is desired to purposely destroy the data that is stored on the media, the media should be blanked by NVBU and have its data securely removed by tools that are designed for such purposes. 2. This command removes all backup indexes for backups on the selected media from the NVBD. 3. The Bulk Blank utility will not work on NVBU 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.

NetVault: Backup Command Line Interface Reference Gude

45

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 NVBUadmin

3.1.3.c

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

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -barcode: This switch followed by the barcode number of the desired media. -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If a media label contains spaces, enclose it within quotes ( ). For example, 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 NVBU to wait until this task has completed before moving forward.

3.1.3.d

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

Important:
1. Media that contains existing backups cannot be re-labelled without first running either nvblankmedia or nvreusemedia commands.

46

Chapter 3 Using NVBU CLI Commands

2. The offsite location of the media can be changed without blanking the media or marking it for re-use. This property is set or changed using the -newoffsitelocation switch.

NetVault: Backup Command Line Interface Reference Gude

47

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -barcode: This switch followed by the barcode number of the desired media. -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If a media label contains spaces, enclose it within quotes ( ). For example, 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 (for example, 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 (for example, 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 NVBU to wait until this task has completed before moving forward.

3.1.3.e

nvlistblankmedia
Use this command to get a list of the slots containing blank media for a given NVBU Server and library.
Syntax

48

Chapter 3 Using NVBU CLI Commands


nvlistblankmedia -servername [servername] -libraryname [library name]

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: The name of the library.

3.1.3.f

nvmakemedia
This command can be used to increase the capacity of a Virtual Tape Library (VTL) by creating additional media files. The following list shows Windows default directories and files that comprise a VTL stored in the user-defined c:\VTL directory:

C:\VTL\ Root directory created on the file system for the VTL. C:\VTL\drives Directory under the VTL root directory where the virtual drives are stored. A sub-directory for each virtual drive will be created in this directory. C:\VTL\slots Directory under the VTL root directory where the virtual slots are stored. C:\VTL\media Directory under the VTL root directory where the virtual media is are stored. C:\VTL\.serial File containing the virtual media barcode and number of virtual drives. For example, 4O4HR-2 where 4O4HR is the barcode and 2 is the number of virtual drive.

C:\VTL\drives\X\.serial File existing in each virtual drive sub-directory containing the barcode and the virtual drive number. For example, 4O4HR-1 where 404HR is the barcode and 1 is the virtual drive number. Whereas 404HR-2 would represent a barcode of 404HR while 2 would represent the second virtual drive.

C:\VTL\slots\1\.media File existing in each virtual slot sub-directory containing the barcode and the virtual media number.

NetVault: Backup Command Line Interface Reference Gude For example, ..\..\4O4HR001 where 404HR is the barcode and 001 is the virtual media number.

49

C:\VTL\media\4O4HR001 Actual virtual media.

The following list shows Linux/UNIX default directories and files that comprise a VTL stored in the user-defined /VTL directory:

/VTL/ Root directory created on the file system for the VTL. /VTL/drives Directory under the VTL root directory where the virtual drives are stored. A sub-directory for each virtual drive will be created in this directory. /VTL/slots Directory under the VTL root directory where the virtual slots are stored. /VTL/media Directory under the VTL root directory where the virtual media is are stored. /VTL/.serial File containing the virtual media barcode and number of virtual drives. For example, 4O4HR-2 where 4O4HR is the barcode and 2 is the number of virtual drive.

/VTL/drives/1/.serial File existing in each virtual drive sub-directory containing the barcode and the virtual drive number. For example, 4O4HR-1 where 404HR is the barcode and 1 is the virtual drive number. Whereas 404HR-2 would represent a barcode of 404HR while 2 would represent the second virtual drive.

/VTL/slots/1/.media File existing in each virtual slot sub-directory containing the barcode and the virtual media number. For example, ../../4O4HR001 where 404HR is the barcode and 001 is the virtual media number.

/VTL/media/4O4HR001 Actual virtual media.

To add a media item, the following steps must be performed: 1. Stop the NVBU Service on the NVBU Server or SmartClient where the VTL is located. 2. In the /tst-vtl/slots directory, create a sub-directory which is one number larger than the existing largest numbered virtual slot directory.

50

Chapter 3 Using NVBU CLI Commands 3. Copy the .media file from one of the virtual slot directories to the virtual slot directory created in step 1. 4. Modify the .media file in the newly created virtual slot directory from ../../1Y2NY00* to ../../1Y2NY00X where X represents the new virtual media number. 5. Use the nvmakemedia command to create the media file. 6. Restart NVBU services.
nvmakemedia <file-size> poplib <library> <file-size> mediafiles <filename>

<file-size> poplib <library>: This form of nvmakemedia command will check all media reference files within the specified <library>, and will offer to create the file if the corresponding media data file does not exist. Enter Y or y to confirm media file creation.

<file-size>: Specify an integer value followed by k for kilobytes, m for megabytes, g for gigabytes, or t for terabytes (for example, 102400k, 50m, 4g, 2t). The minimum file size allowed is 50m. <library>: Specify the full path to the target VTL name. nvmakemedia 50M poplib c:\tst-vtl

Example
Figure 3-1: A media file added to a VTL using the nvmakemedia poplib switch

<file-size> mediafiles <file name>: This form of nvmakemedia command will create a media file of the specified size at the given path.

<file-size>: Specify an integer value followed by k for KB, m for MB, g for GB, or t for TB (for example, 102400k, 50m, 4g, 2t). The minimum file size allowed is 50m. <file name>: Specify the complete file path for the new media file. The media data file name will be the barcode for the media piece. nvmakemedia 50M mediafiles c:\tst-vtl\1Y2NY006

Example

NetVault: Backup Command Line Interface Reference Gude


Figure 3-2: A media file added to a VTL using the nvmakemedia mediafiles switch

51

For more information on expanding VTLs, refer to the NetVault: Backup Advanced VTL Configuration Implementation Guide available at: http://www.bakbone.com/documentation

52

Chapter 3 Using NVBU CLI Commands

3.1.3.g

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. You can specify a few initial characters to search for media items with matching labels. -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 NVBU distribution.

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

NetVault: Backup Command Line Interface Reference Gude

53

3.1.3.h

nvremovemedia
Use this command to delete the media information from the NVDB.

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 NVDB. -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 NVBU distribution.

3.1.3.i

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -barcode: This switch followed by the specific barcode number assigned to the desired media. -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If a media label contains spaces, enclose it within quotes ( ). For example, my media 1. -slotspec: This switch followed by the library and slot number of the desired media (use only when searching by library slot).

54

Chapter 3 Using NVBU CLI Commands

Important:
1. The value input for the -servername parameter must be the NVBU Machine Name of the NVBU Server administering the device, and not simply the name of the system to which the device is locally attached (that is, in the event that the device is locally attached to a SmartClient, you would still name the controlling NVBU Server with this parameter). 2. This command removes all backup indexes for backups on the selected media from the NVDB. 3. 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.

3.1.3.j

nvscanmedia
Use this command to scan for and locate media of the selected type.

Important: This command cannot be used to scan NVSD Devices.


Syntax nvscanmedia [-servername <server name>] -barcode *<barcode> | -medialabel <media label> | -slotspec <library name::slot number> [-wait]

-servername: The NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -barcode: This switch followed by the barcode number of the desired media. -medialabel: This switch followed by the media label of the desired media (use only when searching by media label). If a media label contains spaces, enclose it within quotes ( ). For example, 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 NVBU to wait until this task has completed before moving forward.

NetVault: Backup Command Line Interface Reference Gude

55

Important:
1. This command can be used to import an item of media from another NVBU device, including media previously in a device controlled by a different NVBU 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 NVDB (unless the index entry is already present in the database).

3.1.3.k

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive. -libraryname: The name of the target library.

3.1.3.l

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 NVBU Machine Name of the NVBU Server or Heterogeneous Client to which the target backup device is locally attached. If the device is locally attached to an NVBU Heterogeneous Client (that is, an NVBU SmartClient), this switch must be used to name that Heterogeneous Client. In the event that the device is attached to the local instance of the NVBU Server, this switch can be left out. The NVBU Machine Name is case sensitive.

56

Chapter 3 Using NVBU CLI Commands


-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.

3.1.4

Job Specific Command Line Executables


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

3.1.4.a

nvexpiresaveset
Use this command to expire a backup saveset and remove its entry from the NVDB.
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 (that
is, 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 NVBU distribution.

3.1.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 NVBU Console.
Syntax nvjobabort [-servername <server name>] -jobid <jobid> [-instanceid <instance ID #>]

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

NetVault: Backup Command Line Interface Reference Gude

57

Important: Unless one is specified, NVBU will assume the default Instance ID is 1. 3.1.4.c nvjobcreate
Use this command to create a backup or restore job. A job can be created to be submitted later. This is done by submitting a job title and using pre-defined Selection Sets.
Syntax nvjobcreate [-servername <server name>] -jobtitle <jobtitle> -type <job type> [-selectionsetname <backup/restore selection set name>] [-selectionoptionssetname <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

-servername The NVBU Server that is to administer the job. If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the NVBU Server is to be used to administer the job, this switch can be left out of the syntax. The server name is case sensitive. -jobtitle Input the desired name for the job along with this switch. -type Accompany this switch with the type of NVBU job to be created (for example, -type backup or -type restore). The default job type is backup (that is, if the -type switch is applied with no accompanying backup or restore variable, NVBU 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 NVBU Console, or one can be created from the command line, using the nvsetcreate command, described on page 76. -selectionoptionssetname - (Backup Job Only) Include the name of a Set of Backup options that should be used with a job, with this switch. -schedulesetname The name of the Schedule Set used to set the schedule details for the job. The job will be scheduled to run immediately (that

58

Chapter 3 Using NVBU CLI Commands is, 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 NVBU Console, or one can be created from the command line, using the using the nvsetcreate command that is described on page 76.

-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 NVBU. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (refer to the section, The nvsetmodify.cfg File on page 18 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 (that is, True to enable, and False to disable).

Important:
1. This switch must be followed by a space ( ) before the Tag ID for example, -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, refer to nvsetcreate on page 76.

-targetsetname The name of the Target Set used to specify the target media and drive details. The default target options (as displayed in the NVBU Console) are used if no Target Set is specified. This set can be one that was created and saved in the NVBU Console, or one can be created from the command line using the nvsetcreate command that is described on page 76. -advoptssetname The name of the Advanced Options Set used to specify advanced backup/restore related options. The default Advanced Options (as displayed in the NVBU Console) 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 NVBU Console, or one can be created from the command line, using the nvsetcreate command that is described on page 76. -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. -parameters Use this option to redirect nvjobcreate to read options from a given parameter file, so that you do not need to input them each time the command is run.

NetVault: Backup Command Line Interface Reference Gude

59

You can create this file using any standard text editor. Enter one option (with its value) per line and omit - before the switch. Use spaces or tabs to separate the switch and values. For comments, begin the line with a # character. Such lines will be ignored. Following is an example of a parameter file named example.txt: # nvjobcreate example file jobtitle cli job 1 selectionsetname cliselset This file can be used with the -parameters switch as follows: ./nvjobcreate -parameters example.txt

-version This switch gives the build date of the NVBU 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 NVBU 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 NVBU 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

60

Chapter 3 Using NVBU CLI Commands

3.1.4.d

nvjobdelete
Use this command in order to delete jobs matching the criteria specified by the options from the scheduler.
Syntax nvjobdelete [-servername <server name>] [-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]

-servername: Name of the target NVBU Server. -jobid: Accompany this switch with the numerical job identification value assigned by NVBU to a single job that is to be deleted (for example, -jobid 37).

Important: The -jobid switch may only be used once per use of this command (that is, it
is not possible to delete multiple jobs with a single use of the nvjobdelete command).

-type: Accompany this switch with the type of NVBU job to be deleted (for example, -type backup or -type restore). This option should only be used if a specific job type is to be deleted (that is, leave this option out of the syntax entirely if all NVBU 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 (for example, -jobrange 30-45). -jobtitle: Accompany this switch with the name of the job enclosed in quotes (for example, -jobtitle Full_Backup_1) to delete job(s) with a matching title.

NetVault: Backup Command Line Interface Reference Gude

61

-client: Accompany this switch with the exact NVBU name of an NVBU Client that served as target for the jobs that are to be deleted (for example, -client NV_Client_MKTG). All jobs performed using the named NVBU Client will be deleted. -plugin: Accompany this switch with the exact name of the NVBU APM/ Plugin used in the jobs that are to be deleted. Ensure that the APM/Plugin name is enclosed in quotes (for example, -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 (for example, 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 (for example, 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 (that is, 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 NVDB. -version: This switch gives the build date of the NVBU distribution.

62

Chapter 3 Using NVBU 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

3.1.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> [-phaseid <phaseid>] [-version]

-servername: The NVBU Server that is to administer the job. If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the NVBU Server is to be used to administer the job, this switch can be left out of the syntax. The server name is case sensitive. -jobid: The Job ID of the job that is to be put on hold. -phaseid: Use this parameter to specify the phase ID for the particular phase of a job that is to be put on hold. This is an optional parameter. If you do not specify this parameter, all the known scheduled phases for the job specified using the jobid parameter will be put on hold.

Important: The -jobid switch may only be used once per use of this command (that is, 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 NVBU distribution.

NetVault: Backup Command Line Interface Reference Gude

63

3.1.4.f

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

-servername: The NVBU Server that is to administer the job. If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the NVBU Server is to be used to administer the job, this switch can be left out of the syntax. The server name is case sensitive. -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 (for example, -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. -runinfo: Use this option to display run status and next run time in the output. -version: This switch gives the build date of the NVBU distribution.

64

Chapter 3 Using NVBU CLI Commands

3.1.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]

-jobid: Accompany this switch with the numerical job identification value assigned by NVBU to the single job that is to be modified (for example, -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 NVBU job to be modified (for example, -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 BO: Backup Options Set S: Schedule Set

NetVault: Backup Command Line Interface Reference Gude


65

BT: Backup Target Options Set AB: Backup Advanced Options Set RS: Restore Selections Set AR: Restore Advanced 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 NVBU. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (refer to The nvsetmodify.cfg File on page 18 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 (that is, 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 (for example, Options:<Tag ID>=True/False).

-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 direct nvjobmodify to read options and their values from a given parameter file, so that you do not need to input them each time the command is run. You can create this file using any standard text editor. Enter one option (with its value) per line and omit - before the switch. Use spaces or tabs to separate the switch and values. For comments, begin the line with a # character. Such lines will be ignored. Following is an example of a parameter file named example.txt: # nvjobmodify example file jobname Backup File System 10-15 type backup change Set:BS=selectionsetcli This file can be used with the -parameter switch as follows: ./nvjobmodify -parameter example.txt

-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 =.

66

Chapter 3 Using NVBU CLI Commands

-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 NVBU 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

3.1.4.h

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

-servername: The NVBU Server that is to administer the job. If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the NVBU Server is to be used to administer the job, this switch can be left out of the syntax. The server name is case sensitive. -jobid: The Job ID of the job to be resumed. -phaseid: Use this parameter to specify the phase ID for the particular phase of a job that is to be resumed. This is an optional parameter. If you do not specify this parameter, NVBU will resume all the known phases that are on hold for the job specified using the jobid parameter.

Important: The -jobid switch may only be used once per use of this command (that is, 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 NVBU distribution.

NetVault: Backup Command Line Interface Reference Gude

67

3.1.4.i

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

-servername: The NVBU Server that is to administer the job. If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the NVBU Server is to be used to administer the job, this switch can be left out of the syntax. The server name is case sensitive. -jobid: The Job ID of the job to be run. -phase: The job phase to start. The default value for this option is 1. If this option is not specified, phase 1 of the job is run. -instance: The job instance to start. If this option is not specified or the specified instance does not exist, the last instance of the job is run. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward. -version: This switch gives the build date of the NVBU distribution.

3.1.4.j

nvpolicy
Use this command to perform the following tasks:

List policy jobs Delete a policy Check whether a policy job exists or not Define Clients for a policy job Create a policy definition

Syntax nvpolicy -list [<policy name>] -delete <policy name> -ack <policy name>

68

Chapter 3 Using NVBU CLI Commands


Syntax -addclient <policy name> <client name> [ <client name> ... ] -addgroup <policy name> <group name> [ <group name> ...] -create <policy definition file> -state <policy name> -quiesce <policy name>

-list: This switch will provide a list of existing policies. To view the list of jobs defined for a policy, accompany this switch with the policy name. For example, the following command will list the jobs defined for policy p1. nvpolicy -list p1 -delete: Accompany this switch with the policy name that is to be deleted. -ack: Use this option to acknowledge errors. -addclient: Use this switch to define Clients for the policy job. For example, the following command will add 2 Clients (Client1 and Client2) to the policy job p1. nvpolicy -addclient p1 Client1 Client2 -addgroup: Use this switch to define Client Groups for the policy job. For example, the following command will add 2 Client Groups (Group1 and Group2) to the policy job p1. nvpolicy -addgroup p1 Group1 Group2 -create: Use this switch to define a policy with the details specified in the given file. The format for the policy definition file is shown in the example given below: [Policy] Title=policy3 EvtWarn=Event-Warn-1 EvtFail=Event-Fail-1 Clients=client1,client2,client3,client4 [Job] Title=MyJob Selection=MySelection Options=MyOption Target=MyTarget Schedule=MySchedule

NetVault: Backup Command Line Interface Reference Gude Advanced=MyAdvanced Active=TRUE

69

A policy can contain one or more job definitions. For multiple jobs, include a [Job] section for each job as shown in the example below: [Policy] Title=policy3 EvtWarn=Event-Warn-1 EvtFail=Event-Fail-1 Clients=client1,client2,client3,client4 [Job] Title=MyJob Selection=MySelection Options=MyOption Target=MyTarget Schedule=MySchedule Advanced=MyAdvanced Active=TRUE [Job] Title=MyJob-2 Selection=MySelection-2 Options=MyOption-2 Target=MyTarget-2 Schedule=MySchedule-2 Advanced=MyAdvanced-2 Active=TRUE

-state: Use this switch to find out the current state of a policy (for example, Dormant, Active, or Quiescing) -quiesce: Use this switch to place an active policy in a quiesced state.

3.1.4.k

nvrestore
This tool can be used to list the completed backup jobs, and create restore jobs. The backup jobs listed can be filtered based on date, NVBU Client, APM/Plugin used or selection set used. When creating a restore saveset, it is possible to relocate or rename specific nodes and select nodes for exclusion.

70

Chapter 3 Using NVBU CLI Commands


Syntax nvrestore -list [-client <NVBU Client Name>] [-plugin <APM/Plugin Name> | -select <Selection Set Name>] [-startdate <DD/MM/YY>] [-enddate <DD/MM/YY>] -create <saveset> -title <title> -path <path> [-relocate <path>] [-rename <path>] [run [-wait]] -create <saveset> -definition <restore definition file> [run [-wait]]

-list: Use this option to list all completed backup jobs eligible for restore. It can be used as a standalone command to list all jobs administered by the local NVBU Server, or additional parameters can be set in the syntax of this command to limit the search results:

-client <NVBU Client Name>: Include this parameter and name the desired NVBU Client to limit the listed backup jobs to only those that targeted the named Client. -plugin <APM/Plugin Name>: Include this parameter and name the desired NVBU APM or Plugin to limit the listed backup jobs to only those that used this APM/Plugin. -select <Selection Set Name>: Include this switch, along with the name of the desired Backup Selection Set to limit the listed backup jobs to only those that utilized that Selection Set.

Important: The -plugin and the -select parameters are mutually exclusive (that is,
only one or the other can be used -- they can not both be used in the same Instance of a nvrestore -list command).

-startdate <DD/MM/YY>: Include this parameter and input a desired date to limit the listed output to only those backup jobs that occurred after the specified date. The format input must be the two digit date, followed by the two digit month, and finally the last two digits of the target year (for example, March 1, 2009 would be input as 01/03/09). -enddate <DD/MM/YY>: Include this parameter and input a desired date to limit the listed output to only those backup jobs that occurred before the specified date. The format input must be the two digit date, followed by the two digit month, and finally the last two digits of the target year (for example, November 10, 2009 would be input as 10/11/09).

-create <saveset> -title <desired job title> -path <path>: Use this syntax to create, but not run a restore job. Using this method, you must provide the following information and parameters:

NetVault: Backup Command Line Interface Reference Gude

71

<saveset>: This variable must accompany the -create switch, and it represents the saveset number applied by NVBU to a backup job saveset (for example, as revealed along with the jobs title, when the -list switch is incorporated with the nvrestore command -- <Job Title> (Saveset #)). In addition to the saveset number, you can also preface the saveset number with the target Client Name and the APM/Plugin used, each separated with a colon (for example, NVSERVER:filesystem:59). This is helpful in reducing the amount of time it takes the NVBU CLI utility to locate the desired job. -title <Desired Job Title>: Additionally, you must provide a name for the restore job using the -title parameter, followed by the desired job title name. Once the command has been issued, this is how the job will be labeled (that is, via the nvrestore -list command, and in the NVBU Console). -path <path>: Finally, you must provide the specific path to the directory for the restore. The path named must exist within the same path that was originally backed up. For example, the entire directory, /usr/saved was backed up. A sub-directory, /data was lost from the Client machine, and it must be restored. Therefore, a value of -path /usr/saved/data/ would be input to only recover the /data sub-directory. This methodology is also used to restore individual files. If a single file was lost from a target NVBU Client, the complete file path to it (including the file name) would be included as the -path parameter variable.

Important: You cannot use the -path parameter to relocate data for a restore. This
parameter requires that you input a path value that existed on the Client at the time of backup. To relocate data during restore, you must incorporate the -relocate parameter. For details on its use, refer to its description on page 71. With the command input with the <saveset>, -title <job title> and -path <path> values properly set, once you execute it, a restore job will be created and saved, but not run. This allows you to run the job in the future as desired. The job can be run immediately, if desired, by appending the -run parameter to the end of the syntax (as explained below). In addition, the following optional parameters can be included in the command syntax:

-relocate <path>: Use this parameter to name an alternate directory destination for the restored data. The named directory must exist when the restore job is actually run (that is, you can create and save the job without appending the -run parameter and establish a new directory for relocation in the command, but once the job is actually run, the target relocation directory must exist).

72

Chapter 3 Using NVBU CLI Commands

-rename <path>: Use this parameter to establish a new name value for a restored directory or file. This is especially useful when it is necessary to restore data, but you do not want to overwrite existing files/directories.

Important: Both the -relocate and -rename parameters can be applied in the same line of command syntax. However, their <path> variable is determined by the desired target relocation directory (that is, both parameters must use the same <path> variable, which is the desired relocation directory).

-run [-wait]: Use this command at the end of the syntax to tell NVBU to run the job as soon as the command is executed. If the -run parameter is not appended to the end of the syntax, the restore job will only be created and saved, but not run. In addition, the -wait parameter can be appended to the -run parameter to tell the CLI utility to wait for the restore job to complete, and return a result of job succeeded or job failed, before releasing the prompt for additional commands.

-create <saveset> -definition <restore definition file>: Use this syntax to create, but not run a restore job. Using this method, you must provide the following information and parameters:

<saveset>: This variable must accompany the -create switch, and it represents the saveset number applied by NVBU to a backup job saveset (for example, as revealed along with the jobs title, when the -list switch is incorporated with the nvrestore command -- <Job Title> (Saveset #)). In addition to the saveset number, you can also preface the saveset number with the target Client Name and the APM/Plugin used, each separated with a colon (for example, NVSERVER:filesystem:59). This is helpful in reducing the amount of time it takes the NVBU CLI utility to locate the desired job. -definition <restore definition file>: Use this parameter to specify a file that is comprised of a list of files/directories that were included in the target backup saveset, that should be included and/or excluded from the restore. The <restore definition file> variable refers to the complete path and file name for the file to be used. The file must be set up in the following format:

NetVault: Backup Command Line Interface Reference Gude


Figure 3-3: An example of a file created to use with the -definition parameter, in order to restore a specific list of files

73

[Restore] Title=<desired Restore Job Title> Schedule=<desired Schedule Set to be used> Advanced=<Restore Advanced Options Set to be used> [Include] Path=<the specific path to the directory for the restore. The path named must exist within the same path that was originally backed up. For example, the entire directory, /usr/saved was backed up. A subdirectory, /data was lost from the Client machine, and it must be restored. Therefore, a value of -path /usr/saved/data/ would be input to only recover the /data sub-directory. This methodology is also used to restore individual files. If a single file was lost from a target NVBU Client, the complete path to it (including the file name) would be included as the -path parameter variable. Relocate=<name an alternate directory destination for the restored data. The named directory must exist when the restore job is actually run (that is, you can create and save the job without appending the -run parameter and establish a new directory for relocation in the command, but once the job is actually run, the target relocation directory must exist)> Rename=<Use this parameter to establish a new name value for a restored directory or file. This is especially useful when it is necessary to restore data, but you do not want to overwrite existing files/ directories>

Important: The following rules apply to the set up of file to be used with the -definition
parameter:

74

Chapter 3 Using NVBU CLI Commands

1. The Schedule and Advanced entries must be included beneath the [Restore] stanza with a valid variable input, even if specific Schedule and Restore Advanced Options Sets are not desired. Complete instructions on the creation of these sets can be found in the section nvsetcreate on page 76. In addition, sets created in the NVBU Console can be named with these parameters. Refer to the NetVault: Backup Administrators Guide for more details on these sets and their creation. 2. Only one inclusion can be included per line with the [Inclusion] stanza (that is, if multiple directories/files are to be included they must occupy their own line beneath the [Inclusion] stanza). Correct: [Include] C:\data C:\new C:\Program Files 3. If using the Rename or Relocate parameters, they must exist with a single Instance of the path= parameter, below its own Instance of the [Include] stanza heading. If multiple Instances of the path= parameter existed with a relocate/rename parameter, the CLI would not know which Instance of the path= parameter the rename/relocate command refers to. Correct: [Include] path=C:\data\files relocate=C:\data\new [Include] path=C:\Program Files relocate=C:\Old Program Files Incorrect: [Include] path=C:\data\files path=C:\Program Files relocate=C:\data\new relocate=C:\Old Program Files

NetVault: Backup Command Line Interface Reference Gude

75

4. Both the relocate and rename parameters can be named below the same Instance of the [Include] stanza to perform both operations for a single file/directory. However, their accompanying variable information is determined by the desired target relocation directory (that is, both entries must incorporate the same variable information, which is the path to the desired relocation directory). Correct: [Include] path=C:\data\new (the data to be restored, and its original path) relocate=C:\saved\data (the path data is to be relocated to) rename=C:\saved\data\old (The relocation path directory, from above, along with the new directory name) 5. A target relocation directory must exist on the target system before the restore job is actually run (that is, you can create and save the job without appending the -run parameter and establish a new directory for relocation in the command, but once the job is actually run, the target relocation directory must exist). With the command input with the <saveset> and -definition <restore values properly set, once you execute it, a restore job will be created and saved, but not run (that is, using the Job Title specified in the definition file). This allows you to run the job in the future as desired. The job can be run immediately, if desired, by appending the -run parameter to the end of the syntax (as explained below).

-run [-wait]: Use this command at the end of the syntax to tell NVBU to run the job as soon as the command is executed. If the -run parameter is not appended to the end of the syntax, the restore job will only be created and saved, but not run. In addition, the -wait parameter can be appended to the -run parameter to tell the CLI utility to wait for the restore job to complete, and return a result of job succeeded or job failed, before releasing the prompt for additional commands.

76

Chapter 3 Using NVBU CLI Commands

3.1.4.l

nvsetcreate
Use this command to create 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:
1. A list of the permitted options for any set type may be obtained with the command nvsetcreate type <set type>. 2. For NDMP filers, the nvsetcreate command can only be used to create Backup Selections Set from the CLI. 3. For the NDMP Plugin, nvsetcreate will replace an existing set with the replacement set. Therefore, BakBone recommends you to use nvsetcreate instead of nvsetmodify for the NDMP Plugin.

-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 BO: Backup Options 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 (for example, a file name or directory path) contains the equal sign (=), because it serves as the default assignment character.

NetVault: Backup Command Line Interface Reference Gude

77

-delimit: The character used as a delimiter may be changed using this option. This switch must be used if any user input variable (for example, a file name or directory path) contains a colon (:), because it serves as the default delimiter character. -parameters: Use this switch to redirect nvsetcreate to read options and their arguments from a given parameter file, so that you do not need to input them each time the command is run. You can create this file using any standard text editor. Enter one option (with its value) per line and omit - before the switch. Use spaces or tabs to separate the switch and values. For comments, begin the line with a # character. Such lines will be ignored. Following is an example of a parameter file named example.txt: # nvsetcreate example file setname workbackup type BS client WinClient This file can be used with the -parameters switch as follows: ./nvsetcreate -parameters example.txt

Switches for Creating Backup Selection Sets


-client <client>: The NVBU name of the Client to be backed up. -plugin <plugin>: Accompany this switch with the exact name of the NVBU APM/Plugin used to perform the backup. Plugin names should appear exactly as they do in the NVBU Console. (for example, -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 NVBU Console (each separated by the proper delimiter, / or \ based on the operating system in use on the target Client).

Important:
1. When creating a Selection Set for backing up the root directory using File System Plugin, do not include the last \. Specify only the drive letter. Thus, the path will be C: instead of C:\. Example nvsetcreate -setname testset -type BS -client WINCLIENT1 -plugin File System -include Fixed Drives\C:

78

Chapter 3 Using NVBU CLI Commands

2. When creating backup selection sets for use with the Consolidate Incremental Backups, Data Copy, and Raw Devices Plugins, specify the complete selection path as displayed in NVBU Console with the -include switch:

Use / to separate the tree items (regardless of the O/S in use, the forward slash (/) can be used as a separator) Delimit the path with double quotes Include the complete Saveset Title (for example, /JobTile(Savesetnum) hh:mm DD MM YYYY) Example nvsetcreate -setname DataCopy1 -type BS -client ukwk1115 -plugin Data Copy -include Backups/ukwk1115/File System/spanningTapes (Saveset 106) 11:00 31 jul 2009

3. For Sun NAS 7000 Unified Storage Systems, only volume names can be specified with the -include switch. Directory names are not supported with this switch when creating backup selection sets for these filers using the NDMP Plugin. This is because the Sun NAS 7000 Unified Storage Systems do not offer a true browse capability. They can only list the available volumes. So, the presence of any directory or file in a volume cannot be verified or determined.

-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 Selection 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 NVBU 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 Fixed Drives\C:\work -exclude C:\work\*.txt

NetVault: Backup Command Line Interface Reference Gude

79

Switches for Creating Restore Selection Sets


-client <client>: The NVBU name of the Client to be backed up. -plugin <plugin>: Accompany this switch with the exact name of the NVBU APM/Plugin used to perform the backup. Plugin names should appear exactly as they do in the NVBU Console. (for example -plugin File System). -saveset <n>: Accompany this switch with the ID of the 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 to be restored. If more than one Saveset exists for the job then the newest one will 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 NVBU Consoles 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 (that is, 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 (that is, 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 (that is, 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

80

Chapter 3 Using NVBU CLI Commands

Important:
1. The -include switch must be specified before the -rename switch, if both switches are used for creating a restore selection set using the nvsetcreate command. 2. As noted in the description of the -assign switch on page 76, if a rename value or relocation path to be used contains an = character, then the assignment character must be changed with the -assign switch. 3. If relocating data to a different directory, the new target directory must exist on the target machine before execution of the restore command (that is, you must manually create the desired target directory if it doesnt already exist). NVBU 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 NVBU. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (refer to The nvsetmodify.cfg File on page 18 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 (that is, True to enable, and False to disable).

Important: This switch must be followed by a space ( ) before the Tag ID for example, -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, contact BakBone Support. 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 File System Plugin and the target backup saveset has been assigned the ID 320 by NVBU. 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.

Example Restore Selection Set Creation

NetVault: Backup Command Line Interface Reference Gude 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

81

Switches for Creating Backup Options Sets


-client<client>: NVBU Machine Name of an NVBU Client -plugin<plugin>: The exact name of the APM/Plugin installed on the NVBU Client -backupoption <option=value>: <option=value>: This switch is used to add Backup 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 backup option name as recognized by the CLI, or a numeric value assigned to the option by NVBU. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (refer to The nvsetmodify.cfg File on page 18 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 (that is, True to enable, and False to disable). -backupoptionspath <path>: This switch is only applicable if a given Plugin may specify different backup option screens depending on a selection path within that Plugin, and can be used to specify a particular backup options screen via a selection path.

Example Backup Options Set Creation

nvsetcreate -setname backupoptionset -type BO -client WinClient -plugin "File System" -backupoption NTFSOPT_TYPEINCR=true

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 (for example, -time 11:36). -date <DD-MMM-YYYY>: The date the schedule will start from (for example, -date 25-OCT-2008). -weekdays <ddd[,ddd[,]]>: Use this switch to specify the weekday(s) the scheduled job is to be run (for example, -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 (for example, weeks 1, 3 L).

82

Chapter 3 Using NVBU CLI Commands

-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. (for example, 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. (for example, -every 12months). -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

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 that belongs to a group). -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.

NetVault: Backup Command Line Interface Reference Gude


83

-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

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 (that is, any media used by it may be automatically re-used). The period specified may be in days, weeks or years (for example, -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>: Accompany this switch with TRUE to use network compression for the data that is transferred between NVBU Client and Server. By default the data is not compressed. -verify <bool>: Accompany this switch with TRUE if backup verification has to be done. The default value is FALSE. -migrate <bool>: If set to TRUE the original backup is discarded following the creation of the duplicate copy. The default value is FALSE. -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 ...\scripts directory (where ... refers to the complete path to the installation of NVBU). -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.

84

Chapter 3 Using NVBU CLI Commands


-postscriptarg <value>: Accompany this switch with the value to be given as the user argument to the post script. -encryption <bool>: Accompany this switch with TRUE to enable encryption. The default value is FALSE. -deduplicate <bool>: Accompany this switch with TRUE to enable deduplication. The default value is FALSE. -secondarycopy <bool>: Accompany this switch with TRUE to create a seconday copy. The default value is FALSE. -duplicate <bool>: Accompany this switch with TRUE to use the Duplicate Method for the seconday copy. The default value is FALSE. -datacopy <bool>: Accompany this switch with TRUE to use the Data Copy Method for the seconday copy. The default value is FALSE. -encryptsecondarycopy <bool>: Accompany this switch with TRUE to enable encryption for the secondary copy. The default value is FALSE. -duplicatescheduleset <value>: Accompany this switch with the Schedule Set for performing the secondary copy. -duplicatetargetset <value>: Accompany this switch with the Target Set for performing the secondary copy. -duplicatesource <value>: Accompany this switch with the Source Set for performing the secondary copy. -duplicateclient <value>: Accompany this switch with Server, Original or the alternate Client Name.

Example Backup Advanced Options Set Creation

In the example that follows, the proper syntax is revealed for a 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 NVBU 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.

NetVault: Backup Command Line Interface Reference Gude

85

-postscriptarg <value>: Accompany this switch with the value to be given as the user argument to the post script.

3.1.4.m

nvsetdelete
Use this command to delete the named set of the given type from the NVBU 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 BO: Backup Options Set S: Schedule Set BT: Backup Target Options Set AB: Backup Advanced Options Set RS: Restore Selections Set AR: Restore Advanced Options Set

-version: This switch gives the build date of the NVBU distribution.

3.1.4.n

nvsetexport
Use this command to export the named set(s) of the given type from the NVBU 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.

86

Chapter 3 Using NVBU CLI Commands

-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 BO: Backup Options Set S: Schedule Set BT: Backup Target Options Set AB: Backup Advanced Options Set RS: Restore Selections Set R: Restore Advanced Options Set

-file: Accompany this switch with the name of the file to be created. -version: This switch gives the build date of the NVBU 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

3.1.4.o

nvsetimport
Use this command to import the named set(s) from the input file to the NVBU 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 NVBU distribution.

NetVault: Backup Command Line Interface Reference Gude

87

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 imported set to b=k. nvsetimport -file bandr.nss -assign @ -setname Blackbird@b=k

3.1.4.p

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 BO: Backup Options Set S: Schedule Set BT: Backup Target Options Set AB: Backup Advanced Options Set RS: Restore Selections Set AR: Restore Advanced 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>

88

Chapter 3 Using NVBU CLI Commands 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 section Example - Modifying a Restore Selection Set on page 90.

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 (that is, input the path that is to be changed). Input a new value for the <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 NVBU Client or Plugin, and the <new value> can be the new NVBU 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 NVBU 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,
refer to the description of this switch offered on page 79.

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

NetVault: Backup Command Line Interface Reference Gude

89

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 (that is, 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 NVBU. This may either be the node name as recognized by the CLI, or a numeric ID assigned to the node by NVBU. Both of these values are revealed beneath the [Tree Nodes] heading in the nvsetmodify.cfg configuration file (refer to The nvsetmodify.cfg File on page 18 for information on accessing and viewing this file). Input the value (that is, node name or ID) 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 NVBU Client contains multiple nodes of the given type (that is, 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 NVBU 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 NVBU. Both of these values are revealed beneath the [Plugin Options] heading in the nvsetmodify.cfg configuration file (refer to The nvsetmodify.cfg File on page 18 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 (that is, True to enable, and False to disable).

Important: This switch must be followed by a colon (:) without any spaces before the
Tag ID (for example, Options:<Tag ID>=True/False).

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 NVBU Client name. The <new value> specifies the new target Client.

90

Chapter 3 Using NVBU CLI Commands

-parameters: Use this switch to redirect nvsetmodify to read options and their arguments from a given parameter file, so that you do not need to input them each time the command is run. You can create this file using any standard text editor. Enter one option (with its value) per line and omit - before the switch. Use spaces or tabs to separate the switch and values. For comments, begin the line with a # character. Such lines will be ignored. Following is an example of a parameter file named example.txt: # nvsetmodify example file setname BackSet1 type BS This file can be used with the -parameters switch as follows: ./nvjobmodify -parameters example.txt

-assign: The character used for assignment may be changed using this option. It must be used if values contain the default assignment character (that is, the equal sign -- =). -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 NVBU distribution.

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 the 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 NVBU to overwrite newer files, and perform the restore to a different directory (that is, 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

NetVault: Backup Command Line Interface Reference Gude

91

3.1.4.q

nvtrigger
Use this command in order to trigger an NVBU job that has already been pre-defined in the NVBU Console and saved as a triggered job (via the Triggered option of the Schedule tab. For complete details on this option, refer to the NetVault: Backup Administrators Guide).

Important: This command is located in the ...\bin directory.


Syntax nvtrigger [-server <server name>] [-wait] -verbose -killonexit <trigger name>

-server: The name of the NVBU Server that will administer the job. If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the Server is to be used to administer the job, this switch can be left out of the syntax. The server name is case sensitive. -wait: This switch can be added to tell NVBU to wait until this task has completed before moving forward. -verbose - Use this switch to display additional information when the job is initiated and finishes. The details displayed when the job is initiated include Job ID, Instance ID, Job Title, and Start Time. When the job completes, the finish time is displayed. -killonexit - This option can be used with -wait to abort a job by terminating the trigger execution. <trigger name>: The name of the trigger to be used. This must be the last parameter when the tool is invoked as shown in the example below:

nvtrigger -server <server name> -wait -verbose -killonexit <triggername>)

92

Chapter 3 Using NVBU CLI Commands

Important:
1. 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. Without the -wait switch, the nvtrigger command supports multiple jobs. However, with this switch, the nvtrigger command can only be used to trigger a single job. This limitation also applies to -wait -killonexit switches. As a result, you cannot use this switch for policy jobs that contains multiple job definitions.

3.1.5

NVBU Logs Command Line Executables


NVBU offers various Command Line Executables that can be used in the management of NVBU 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.

3.1.5.a

nvlogdump
Use this command to dump NVBU 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: NVBU 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: Specify a file name for the log dump. If you do not enter the complete path, the dump file is saved to ...\log\dumps\<text> or <binary> folder. In this path ... represents the installation directory for NVBU and <text> or <binary> represent the name of the final folder based on the selected dump format. If this switch is omitted, then NVBU creates a file named CLI_DUMP_<YYYYMMDD>_<HHMMSS> in the specified format. The

NetVault: Backup Command Line Interface Reference Gude

93

extension .nlg is suffixed for binary log dumps while no extension is suffixed for text dump files.

-text: Variable set to have a text file created. If you omit this switch then logs are dumped in binary format. -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.

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 (for example, 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 40, from July 20, 2010 at 8:33pm and 4 seconds, to a binary file named nvlogdmp.nlg. nvlogdump -filename c:\temp\nvlogdmp -starttime 20100720203304 -jobid 40

3.1.5.b

nvlogpurge
Use this script to purge all NVBU log entries from the NVDB 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.

94

Chapter 3 Using NVBU CLI Commands


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).

3.1.5.c

nvreadlog
NVBU log information can be reviewed through the use of this command.
Syntax nvreadlog [-h] [-b <days>] [-m] [-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 (for example, nvreadlog -help).

-b: This tag followed by a number value determines the number of days prior, from which a dump is to begin. -m: Used in conjunction with the -b switch, this switch causes the log output to begin from midnight preceding the number of days specified with the -b option. For example, at 3 p.m., you specify -b 1, NVBU will print logs from 3 p.m. the day before. With -m, the logs will begin from midnight of the previous day. Also, if -m is given on its own or with -b 0, then logs are printed from midnight of the current day. Therefore, if you issue this command at 3 p.m., then NVBU will print 15 hours of logs. -d: Adding this tag accompanied by specific character(s) alerts the interface on how to separate displayed data (for example, -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 (for example, -o <failed> would display only operator messages that

NetVault: Backup Command Line Interface Reference Gude

95

included the word failed). Multiple items can be included for this variable, separated by a comma.

3.1.6

Other Command Line Executables


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

3.1.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, refer to the NetVault: Backup Configuration Guide).

3.1.6.b

getmachineid
Use this command to obtain the NVBU Machine ID for the current NVBU Server or Client. The NVBU Machine ID is required when requesting license keys.

3.1.6.c

installplugin
This command can be used to install various NVBU Plugins from the command line interface.

Important: This command is located in the ...\bin directory.


Syntax installplugin <File path for the installation file>

Provide the complete file path for the .npk installation file for the Plugin. An example is given below: installplugin C:\Tst\<file name>.npk

3.1.6.d

licenseinstall
Use this command to install license for the NVBU software or the APMs/Plugins using the key file (that is, the.npk file containing the key) or the key string.

Important: This command is located in the ...\bin directory.


Syntax licenseinstall <keyfile> | <key string>

96

Chapter 3 Using NVBU CLI Commands

3.1.6.e 3.1.6.f

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

nvmeddbcheck
This command performs an integrity check of the NVBU Media Database, which include checks on the following:

Raw file structure Database table integrity Inter-table references and dependencies

The nvmeddbcheck command can take one of the following arguments: List, Check, Compact or Force.

Syntax nvmeddbcheck List | Check | Compact | Force [-v <warning level>]

List: Use this option to print a line of output for every backup record, new stream, old stream, session, segment, media, and backup index in the database. This is particularly useful in order to determine which records should be deleted. Check: Use this option to perform database checks and display the status. Compact: Use this option to perform the database checks, fix faults identified during the check phase and compact the database. The fix and the compact phases are only performed if the last successful backup was an NVDB backup. Force: Use this option to perform the database checks, fix faults identified during the check phase and compact the database regardless of the type of last successful backup. -v: Use this option to specify the minimum Warning Level for the error messages that are displayed during the command execution. The Warning Level value can be one of the following:

all All messages back Background messages inf Information messages job Job messages warn Warnings error Errors severe Severe errors

NetVault: Backup Command Line Interface Reference Gude

97

3.1.6.g

nvpassword
Use this command to change the NVBU password for the machine on which this command is run. There are no switches to be used with this command. Type the command followed by the new NVBU password with a space separating the command and the new password.

Important: This command is located in the ...\bin directory. 3.1.6.h 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 (for example, 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: NVBU Machine Name of the NVBU Heterogeneous Client. -account: Name of user account to be used with this command. -password: The password associated with the user account.

Important: Refer to the NetVault: Backup APM User's Guide for Oracle or NetVault:
Backup APM User's Guide for Informix for more information.

3.1.6.i

nvreport
This command allows you to utilize NVBUs 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, refer to Appendix A: Running Reports from the CLI on page 103.

3.1.6.j

nvscheddbcheck
This command performs an integrity check of the NVBU Scheduler Database, which include checks on the following:

Raw file structure Database table integrity Inter-table references and dependencies

98

Chapter 3 Using NVBU CLI Commands The nvscheddbcheck command can take one of the following arguments: List, Check or Compact.

Syntax nvscheddbcheck List | Check | Compact [-v <warning level>]

List: Use this option to print a line of output for every policy, job, instance, instance data record, scheduled phase, and change record in the database. This is particularly useful in order to determine which records should be deleted. Check: Use this option to just perform database checks. Compact: Use this option to perform the database checks, fix faults identified during the check phase and compact the database. -v: Use this option to specify the minimum Warning Level for the error messages that are displayed during the command execution. The Warning Level value can be one of the following:

all All messages back Background messages inf Information messages job Job messages warn Warnings error Errors severe Severe errors

3.1.6.k

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

NetVault: Backup Command Line Interface Reference Gude


99

-d: The email address of the intended recipient. -r: The actual name of the intended recipient. -s: The subject line of the email. -f: The email message file to be sent. -a: If it is necessary to attach a file to the email, 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.

3.1.6.l

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

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

3.1.6.m

nvsvtlgrow
The command offers three functions:

Display the current status and usage of a given existing SVTL or all SVTLs on the current machine. Perform a test/dummy expansion of an SVTL by a given number of media items of a given size. Perform an actual expansion of an SVTL by a given number of media items of a given size.

This utility is present in the ...\bin directory (where ... represents the NVBU installation directory).
Syntax nvsvtlgrow display [ -device svtl-device ] test -device svtl-device -size media-size -count media-count grow -device svtl-device -size media-size -count media-count

display: Use this option to display all SVTLs on the machine. To display the status of a single SVTL on the machine issue the following command: nvsvtlgrow display -device <svtl-device>

100

Chapter 3 Using NVBU CLI Commands

test: Use this option to perform a test expansion.


-device: Follow this switch with the name of the target SVTL. -size: Follow this switch with the size of the media (for example, 800 m for 800MB, 40 g for 40GB, 2 t for 2TB). -count: Follow this switch with the number of media items to be added.

The utility will check these values against the available space and report whether it would be possible to create these media items. No changes will be made to the SVTL.

grow: Use this option to actually expand the SVTL capacity.


-device: Follow this switch with the name of the target SVTL. -size: Follow this switch with the size of the media (for example, 800 m for 800 Megabytes, 40 g for 40 Gigabytes, 2t for 2 Terabytes). -count: Follow this switch with the number of media items to be added.

The utility will check the parameters and upon confirmation from the user will actually add the new media items to expand the SVTL size. Re-add the SVTL or restart NVBU Services to use the added media.

Appendix

Appendix A:

Running Reports from the CLI


A.1.0 - NVBU Reporting with the CLI ................................................................... 105
A.1.1 - CLI Help ................................................................................................................ 105

A.2.0 - Using nvreport to View Reports from the CLI.............................. 105


A.2.1 - Report Classes...................................................................................................... 106 - A.2.1.a - Using the -class Switch ................................................................................... 106 - A.2.1.b - Canned Reports ............................................................................................... 106 A.2.2 - Template File Switches .......................................................................................... 116 - A.2.2.a - Outputting Reports Using a Template File............................................................ 116 A.2.3 - Adjusting Report Layout and Content.................................................................... 120 - A.2.3.a - Prerequisites .................................................................................................... 120 - A.2.3.b - Format Switch .................................................................................................. 122 - A.2.3.c - Sort Switch....................................................................................................... 127 - A.2.3.d - Including/Excluding Data from Reports ................................................................ 128 - A.2.3.e - Title Switch ...................................................................................................... 132

A.3.0 - External Reports ............................................................................................. 133


A.3.1 - Creating External Report Files ............................................................................... 133 - A.3.1.a - Phase 1: Inputting Name Template File to Be Used .............................................. 133 - A.3.1.b - Phase 2: Apply the Outputdir Switch ................................................................... 154 - A.3.1.c - Phase 3: Set Format Options for the Output Report (Optional) ............................... 156

104

Appendix A Running Reports from the CLI

NetVault: Backup Command Line Interface Reference Gude

105

A.1.0

NVBU Reporting with the CLI


Probably the most versatile command line utility available for use with NVBUs Command Line Interface is the nvreport command. This command allows the user to take advantage of NVBUs extensive reporting tools from the command line and display them in the terminal session window. This appendix provides a detailed description of the nvreport command and its various switches. Where applicable, it also provides a comparison between the CLI and the NVBU Console reporting functionality.

A.1.1

CLI Help
Extensive help is available from the command line for this feature by typing the command followed by the -help switch (for example, 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 (for example, nvreport -help templatename).

A.2.0

Using nvreport to View Reports from the CLI


The nvreport command allows the powerful NVBU Reporting engine to be driven from the command line. The command reports on a specific Class of NVBU 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 [servername] -class [classname] -templatename [template name] -or-templatefile [complete path to template file]

-server: The name of the NVBU Server that will administer the report job. With a remote instance of an NVBU Server named, that Servers NVDB will be analyzed for the desired report information (for example, if a report was run regarding media usage, resulting data pertaining to media in use by that NVBU Server would be revealed in the resulting report). If the job is to be administered by a remote NVBU Server, this switch must be used to name that specific Server. If the local instance of the NVBU Server is to be used, this switch can be left out of the syntax. The servername is case sensitive. -class [classname] - This applies to the specific Class of NVBU functionality for which the report will gather information. Pre-defined or Canned Reports are run using this switch. A detailed explanation on this

106

Appendix A Running Reports from the CLI switch and its proper usage is outlined in the section, Report Classes on page 106.

-templatename [template nice name]/-templatefile [complete path to template file] - This switch allows you to call out specific files that have 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 NVBU Console; 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 File Switches on page 116.

A.2.1

Report Classes
NVBU 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, refer to the section Template File Switches on page 116.

A.2.1.a

Using the -class Switch


The example below shows how the -class switch is used to name a specific NVBU 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:\NVBU\util>nvreport -class Clients Component Clients at 11:06:53, 09 Oct 2009 Client NameTypeStatusServerAccessPreferred AddressContact

A.2.1.b

Canned Reports
As previously noted, each NVBU 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:

NetVault: Backup Command Line Interface Reference Gude nvreport -class Client Groups

107

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 shown in the following table) or all lower-case letters.
Class Name Advanced Options Canned Report Result 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. All operations attempted in NVBU 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. 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. 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. The status of all Clients currently added to the NVBU Server will be displayed. Information provided includes: Added Client Name Version of NVBU 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

108

Appendix A Running Reports from the CLI


Class Name Defined Jobs Canned Report Result All jobs that have been created on the NVBU Server are displayed. In addition, specific information pertaining to each job is displayed, including the following: Job ID Number Job Title Client Name - The Client on which 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 (for example, 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). Specific information pertaining to any events that may have occurred with drives under the control of the NVBU Server will be displayed, including the following: Time - The time the event occurred Date - The date the event occurred Drive Name - The name of the drive as recognized by NVBU. Event - The type of event that occurred (for example, start write, stop write, etc.) Information will be displayed in a table-format that offers performance statistics for all drives currently under the control of the NVBU 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 drive accessed for the job Job Id - The NVBU identification number assigned to the specific job. Instance - The instance of the specific job (that is, a value of 2 indicates the second time this job has been run). Rate(kb/sec) - The average rate at which NVBU transferred data to media in the named drive for the specific job.

Drive Events

Drive Performance Statistics

NetVault: Backup Command Line Interface Reference Gude


Class Name Drives Canned Report Result

109

Information pertaining to the drives accessible to NVBU will be displayed in a table, including: DriveName The name of the drive as recognized by NVBU. Product The product name. Vendor The vendor name. Status The current status of the drive (online/offline). DriveMachine The machine to which the drive or library is locally attached. DriveDataWritten Data written by this drive. DriveDataRead Data read by this drive. Information will be displayed regarding the entry/exit ports that exist in any libraries currently under the control of the NVBU 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. Information pertaining to the completion status of all NVBU jobs will be displayed 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 NVBU identification number assigned to the specific job. Instance - The instance of the specific job (that is, 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 (for example, Backup, Restore, Report) Exit Status - The status of the job once it completed (for example, Completed, Completed with errors, Failed, etc.). Run Length - The total amount of time the job took to reach its Exit Status. Information pertaining to the any library devices currently under the control of the NVBU Server will be displayed, such as: Library ID - Unique internal library ID. Library Name - The name assigned to the library when it was added to NVBU. Library Status - The current status of the library (for example, online/offline). Library Machine - The Library's Controlling NVBU Server.

Entry/Exit Ports

Job History

Libraries

110

Appendix A Running Reports from the CLI


Class Name Library Drives Canned Report Result Information will be displayed regarding the drives that exist in any libraries currently under the control of the NVBU 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. Information will be displayed regarding the slots that exist in any libraries currently under the control of the NVBU 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. Information pertaining to licensing installed for the NVBU Server will be displayed. Information regarding all media currently in use by devices under the control of the NVBU Server will be displayed. This includes the following: Group - The Group Label to which the selected piece of media belongs (that is, the media has been assigned a group label in NVBU). Label - The NVBU media label assigned Space Left - The amount of space still available for use Space Used - The amount of space on the media used by NVBU Format - The format of the piece of media (for example, MTF=Windows-based/UTF8=Linux/UNIX-based) Need Import - Yes indicates that the media is marked as Foreign and must be scanned to read the ontape indices into the NVDB. Need Recovery - Yes implies that the contents on the tape (particularly, the last known backup on the tape) are considered suspect. The tape must be scanned for backups for which indexes are not recorded in the NVDB. In some cases, a backup job will automatically scan a tape that is in Need Recovery state in order to be able to use if of the current backup. Unusable - Whether or not the media has been marked as unusable in NVBU (for example, Yes=Marked as Unusable/No=Not Marked) Information pertaining to the capacity of any media available in the libraries/standalone drives under the control of the NVBU Server will be displayed.

Library Slots

License Capabilities Media

Media Capacities

NetVault: Backup Command Line Interface Reference Gude


Class Name Media Job Contents Canned Report Result

111

Information pertaining to the backup jobs contained on available media is displayed, including: Label - The NVBU media label assigned Group - The Group Label to which the selected piece of media belongs (that is, the media has been assigned a group label in NVBU). Barcode - The barcode value assigned to the selected piece of media housing the job Job Title - The name of the job, as set in NVBU Client Name - The name of the NVBU 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. Information pertaining to the requests made to any media available in the libraries/standalone drives under the control of the NVBU 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 NVBU identification number of the job that made the media request. State - The status of the request Information pertaining to backup job segments in relation to media used by available devices will be displayed, including the following: Label - The NVBU 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 NVBU Client Name - The name of the NVBU 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

112

Appendix A Running Reports from the CLI


Class Name Media Transfer Requests Canned Report Result Information pertaining to the transfer requests made to any media available in the libraries/standalone drives under the control of the NVBU Server will be displayed, including: Job Id - The NVBU 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 (for example, read/ write). Request Id - The identification number for the request, as assigned by NVBU. Transferred - The amount of data transferred per this request. A table will be displayed that offers a description of all NVBU events, broken down into their respective event classes. NVBU events allow you to set up a trigger that will occur when the event happens in NVBU (for example, an e-mail can be sent when an NVBU event occurs). Refer to the NetVault: Backup Administrators Guide for details on setting up NVBU events. Information will be displayed pertaining to the occurrence of various NVBU events. Information includes: Date/Time of Event Event Name Event Class - The class the selected NVBU event belongs to. Description - Brief information describing the event. Event Message - The message issued as a result of this event. All log entries currently housed in the NVDB will be displayed in the terminal session window. Based on the number of log entries that exist in the NVDB, it may take several minutes (or longer) for this command to reveal results (that is, the greater the number of log entries, the longer it will take to process the information and display the results).

NetVault Event Types

NetVault Events

NetVault Logs

NetVault: Backup Command Line Interface Reference Gude


Class Name Notifications Canned Report Result

113

Information is displayed pertaining to how the current Global Notifications profile is set up (via the NVBU Global Notification window in the NVBU Console). Information includes: Notify Class - The class designation of the selected global notification. Notify Event - The NVBU 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 (for example, sysop operator message, sysop e-mail, run a job, etc.). 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 (for example, represented as Outstanding? Yes=Not acknowledged/No=Acknowledged). If no operator messages appear in this frame (they have all been acknowledged and/or deleted) this report will return no information. 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 NVBU Console. Jobs - This will display the total number of jobs that have been created within the policy. Clients (#) - This will display total number of NVBU Clients that have been set up to run the jobs in the policy. Status - The current status of the policy (for example, 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 NVBU Clients that have been set up to run the jobs in the policy. Information pertaining to the NVBU Client established for a policy will be displayed, including: Policy Name - The name given to the policy in the NVBU Console. Client Name - The name of an NVBU Client that has been set up in the policy. Status - The current status of the policy (for example, OK if all of the Clients in the policy are accessible; and Errors if errors have occurred).

Operator Messages

Policies

Policy Clients

114

Appendix A Running Reports from the CLI


Class Name Policy Jobs Canned Report Result Information pertaining to the jobs set up in a policy will be displayed, including: Policy Name - The name given for the policy in the NVBU Console. 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. Information is displayed that lists the privileges currently granted to each user account set up on the NVBU Server (that is, for each account set up using the Access Control functionality offered in the NVBU Console). At default, NVBU has two accounts Administrator and Default. If no other user accounts have been set up for use, these two will be all that is displayed if this report is run. All report template files that are saved in the ...\reports\templates directory will be displayed. 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 NVBU report class to which the template file belongs Output Type - The designated output type for this templates report . The output types include the following: Plain Text will generate a report viewable from a terminal session window. HTML Text will generate an HTML-based report suitable for viewing in a browser application. CSV Text template file will generate a comma separated report which can be imported to a spreadsheet application. 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.

Privileges

Report Templates

Schedule Sets

NetVault: Backup Command Line Interface Reference Gude


Class Name Segments Canned Report Result

115

Information pertaining to any segments of a backup job will be displayed, including: Job Id - the identification number assigned to the backup job by NVBU Instance - The instance of the Job Id run (for example, 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. 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. 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: NVBU 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: NVBU Client Name > APM/Plugin Used > Root Node Name (if app.) > Backup Saveset Name and Information > Target Restore Path

Selection Option Sets

Selection Sets

116

Appendix A Running Reports from the CLI


Class Name Users Canned Report Result Information pertaining to all user accounts set up on the NVBU Server via the Access Control functionality will be displayed, 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 NVBU (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 NVBU. Logon Time - The last time at which this account accessed NVBU.

A.2.2

Template File Switches


As briefly noted in the previous section, NVBUs 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.

A.2.2.a

Outputting Reports Using a Template File


NVBU 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 file path (including the file name) for the desired template file: nvreport -templatefile C:\NVBU\reports\templates\logsclidefault

NetVault: Backup Command Line Interface Reference Gude


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

117

C:\NVBU\util>nvreport -templatefile C:\NVBU\reports\templates\clientsclidefault Component Clients at 11:06:53, 10 Jul 2009

Important:
1. The files pertaining to all report templates can be found in the following directory (that is, where ... refers to the complete path to the installation of NVBU): ...\reports\templates 2. If the value input for the file path contains any spaces, the entire variable must be enclosed in quotes (for example, -templatefile C:\NV Backup\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 NVBU Console (for example, 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:\NVBU\util>nvreport -templatename Client Machines - cli default template Component Clients at 11:06:53, 10 Jul 2009

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.

118

Appendix A Running Reports from the CLI

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 ...\NVBU\reports\templates\clientsclidefault

The following table lists the class name of the 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 Entry/Exit Ports Job History Template File Used to Generate Canned Report NVBU Console Nice Nameb Advanced Options - cli default template Audits - cli default template Backup Targets - cli default template Client Machines - cli default template File Namec advancedoptionsclidefault auditclidefault backuptargetsclidefault

Client Groups - cli default template groupsclidefault clientsclidefault

Defined Jobs - cli default template jobdefinitionsclidefault Drive Events - cli default template driveeventsclidefault Drive Performance Statistics - cli default template Drives - cli default template Entry/Exit Ports - cli default template Executed Job History - cli default template driveperformanceclidefault

drivesclidefault entryexitportsclidefault jobhistoryclidefault

NetVault: Backup Command Line Interface Reference Gude


Canned Report Class Namea Libraries Library Drives Library Slots License Capabilities Media Template File Used to Generate Canned Report NVBU Console Nice Nameb Libraries - cli default template Library Drives - cli default template Library Slots - cli default template File Namec librariesclidefault librarydrivesclidefault libraryslotsclidefault

119

This Server's License Capabilities licensecapsclidefault - cli default template Media - cli default template mediaclidefault mediacapacitiesclidefault mediajobcontentsclidefault mediarequestsclidefault

Media Capacities Media Capacities - cli default template Media Job Contents Media Requests Media Segment Contents Media Transfer Requests NetVault Event Types NetVault Events NetVault Logs Notifications Operator Messages Policies Policy Clients Policy Jobs Privileges Report Templates Schedule Sets Segments Media Contents Query - Textual Media Requests - cli default template

Media Segment Contents Query - mediasegmentcontentsclidef Textual ault Media Transfer Requests - cli default template NVBU Event Types - cli default template NVBU Logs - cli default template User's Selected Notifications - cli default template Operator Messages - cli default template Policies - 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 mediatransfersclidefault eventtypesclidefault

NVBU Events - cli default template eventsclidefault logsclidefault notificationsclidefault operatormessagesclidefault policiesclidefault policyjobsclidefault privilegesclidefault reporttemplatesclidefault schedulesclidefault segmentsclidefault

Policy Clients - cli default template policyclientsclidefault

120

Appendix A Running Reports from the CLI


Canned Report Class Namea Selection Option Sets Selection Sets Users Template File Used to Generate Canned Report NVBU Console Nice Nameb Selection Option Sets - cli default template Selection Sets - cli default template Users - cli default template File Namec seloptionsclidefault selectionsclidefault usersclidefault

a. This variable is used in conjunction with the -class switch 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, review the table in the section Canned Report Descriptions on page 107. 2. NVBU offers many additional template files that are not covered in this table (that is, 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.2.3

Adjusting Report 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 (that is, those with clidefault/- cli default template in their file name that are designed to be viewed from a terminal session window).

A.2.3.a

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

Locating Report 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.

NetVault: Backup Command Line Interface Reference Gude

121

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 (for example, JOBID for the Job ID and TRANSITION for the State).
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

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 (that is, how it is labeled in the template file). The second contains the field name for the column (that is, 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

122

Appendix A Running Reports from the CLI

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 (for example, 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 -- refer to the section Format Switch on page 122 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.

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 (that is, where ... refers to the path to the installation of NVBU): ...\reports\templates

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 %

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.2.3.b

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 (for example, 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 Report Real Name Field Values on page 120, you must have the real name value that applies to the field that is to be modified with the -format switch.

NetVault: Backup Command Line Interface Reference Gude

123

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.

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: example where -format switch was used and only three of the available four fields were named, therefore only three are revealed

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 (for example, %TRANSITION::3 will limit the display in the Status column to only the first three characters).

Figure A-8: Example where ::3 was appended to the %TRANSITION variable in order to limit the character width in the Status column to three characters

124

Appendix A Running Reports from the CLI

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. C:\NVBU\util>nvreport -class media Requests -format %Date %Time %JOBID %TRANSITION %\n Component media requests - cli default template at 11:06:53, 10 Jul 2009 DateTimeJob IdStatus

Figure A-9: Example where %/n was appended to the end of the string of variables in order to insert a line break between each report entry

Adding Additional Information Columns (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 nvreport -help fields drives

3. At the terminal session prompt, the following command was issued: 4. All of the Fields available for use with the drives class template file were revealed. At this stage two tasks were performed:

NetVault: Backup Command Line Interface Reference Gude

125

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 NVBU Server. In scanning the list of available fields, Drive Write Errors is located in the Field Names column, so its 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

Important:
1. Before choosing an additional Field to be used in a reports output, review the full list of those available for a template file (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. 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.

126

Appendix A Running Reports from the CLI

3. In instances when the drives or media classes default template files are used to add additional columns 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 NVBU Server. In addition, it is also possible to list the frequency of these errors based on their occurrence with actual media in a library. Both of these methods 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 (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.

NetVault: Backup Command Line Interface Reference Gude

127

A.2.3.c

Sort Switch
The -sort switch can be used to sort the entries on a selected field. A sort expression is specified in 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. [+/-] Accompany the field name with + to sort the result in ascending order of the specified field, or - to sort the results in descending order.

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 (that is, 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 121).
Figure A-11: Report was set up to sort based on the title of jobs, in ascending order

Additional Considerations

Fields Real Name, as Set in the Template File Must be Used - As explained in the section Locating Report Real Name Field Values on page 120, 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.

128

Appendix A Running Reports from the CLI

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 (that is, 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: 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:\NVBU\util>nvreport -class Job History -sort %TITLE+ %EXITSTATUS+ Component Executed Job History - cli default template at 11:06:53, 11 Jul 2009
Start Date 07 Jul 2009 Start Job Id Instance Job Title 23:00:01 31 2 All Full
The primary sort variable - all jobs are sorted alphabetically by job title, first.

Type Backup

Exit Status Aborted

Run Length 00:02:11

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

A.2.3.d

Including/Excluding Data from Reports


Through input of the proper syntax, you can tell NVBU what resulting data should be displayed when a report is run (that is, 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 NVBU job assigned the Job ID of 33, you would include 33 as the [constant].

NetVault: Backup Command Line Interface Reference Gude


Figure A-13: Report was set up to only include entries that correspond to Job ID 33

129

C:\NVBU\util>nvreport -class Job History -include %JOBDEFINITIONID = 33 Component Executed Job History - cli default template at 11:06:53, 10 Jul 2009
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 (for example, 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 (for example, does the named client have the Server version of NVBU 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 an NVBU event occurred (for example, nvreport -class job history -include %STARTDATE >= [Date]. This can be input in two ways: Specific Date: Input in the following formats: YYYY/MM/DD (2005/01/15) - Year/Month/Date YYYYMMDD (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)

Boolean Arguments (boolean)

Date

130

Appendix A Running Reports from the CLI


Constant Type Days of the Week (daysinweek) 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 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 (for example, 1, 2, 4, 8, 23 would include the first, second, fourth, eighth and twenty-third days in the month) For fields that 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 (for example, 764874497498723497 - no commas needed). For fields that display a numeric value as their resulting data (for example, nvreport -class job history -include %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 (for example, the Exit Status of an NVBU job) nvreport -class job history -include %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).

Days of the Month (daysinmonth)

Count of Hours, Days, Weeks, Months and Years (hdwmycount) Large Number Value (Integer) Number Value (Integer)

pluginscreen selectiontree String of Text (String)

NetVault: Backup Command Line Interface Reference Gude


Constant Type System Time (Systime) Description

131

Specific time applying to an NVBU event that occurred in relation to the system time on the NVBU Server. This can be input in two ways: Specific Time: The number of seconds that have passed since midnight, on January 1st 1970: (for example, 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 -- for example, now-30mi would be 30 hours ago) This applies to a specific time an NVBU event occurred - for example, nvreport -class "job history" -include "%STARTTIME >= [Time]" This can be input in two ways: Specific Time: Input in the following formats: 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. 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 (for example, 134L would include the first, third, fourth, and last week in the month)

Time

Unique Weeks of the Month (weeksinmonth)

Additional Considerations

Fields Real Name, as Set in the Template File Must be Used - As explained in the section, Locating Report Real Name Field Values on page 120, 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.

132

Appendix A Running Reports from the CLI

Multiple Include/Exclude Arguments Can Be Linked - Through the use of boolean arguments, multiple include/exclude arguments can be applied (for example, 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 ( ).

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

C:\NVBU\util>nvreport -class Job History -include (%JOBDEFINITIONID > 10 AND %INSTANCEID < 5) OR %TYPE = restore Component Executed Job History - cli default template at 11:06:53, 15 Jul 2009
Start Date 01 Jul 2009 02 Jul 2009 03 Jul 2009 04 Jul 2009 05 Jul 2009 Start 1:00:01 16:15:01 11:04:43 23:00:01 23:00:01 Job Id 31 15 14 32 32 Instance 3 1 1 1 1 Job Title Master_D Report1 Report2 All Full All Full Type Backup Report Report Backup Backup Exit Status Aborted Completed Completed Completed Aborted Run Length 0:22:23 0:00:03 0:00:02 0:05:32 0:02:11

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.2.3.e

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>

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). 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.

NetVault: Backup Command Line Interface Reference Gude

133

A.3.0

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, NVBU 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 (for example, they can be opened for viewing in an HTML-based browser software; they can be sent as e-mail attachments for others to view, etc.). This is all made possible through the use of the proper switches in the nvreport command syntax.

A.3.1

Creating External Report Files


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.

Phase 1: Name the Template File to be Used - Through the use of the appropriate template-related switch (for example, -templatename or -templatefile). The section, Phase 1: Inputting Name Template File to Be Used on page 133 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 NVBU to create an external version of the report. It also asks that you name a subdirectory 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.

A.3.1.a

Phase 1: Inputting Name Template File to Be Used


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 (for example, -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 NVBU Console (for example, 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 NVBU Report template

134

Appendix A Running Reports from the CLI files are housed in the following sub-directory of the NVBU installation directory (that is, where ... refers to the complete path to the installation of NVBU): ...\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 (that is, 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 canned templates that have been specifically designed for output and viewing from the command line. You may have noticed that NVBU also offers 50 additional template files for use -- these additional files are used to generate HTML-based reports for viewing from the NVBU Console. However, when used in conjunction with the -outputdir switch, you can generate an HTML-based file for the report that can be viewed externally.

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.

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb Currently Active Jobs

135

Template File Namea activejobs

Description of HTML-based Report Summary information of all jobs that are currently running and active is displayed (for example, Backup, Restore and Report jobs). The information includes: Job Identification Number Job Title Client Name - The name of the NVBU 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 (for example, Writing to Media). Information pertaining to all drives accessible to the NVBU Server will be displayed. Machine - The machine to which the drive is attached. Drive Name - The name of the drive as recognized by NVBU. 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

136

Appendix A Running Reports from the CLI


Nice Name Valueb Failed Policy Jobs

Template File Namea allfailedpolicyjobs

Description of HTML-based Report 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 NVBU completed it (for example, Backup Completed with Warnings). 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. The status of all Clients currently added to the NVBU Server will be displayed. Information provided includes: Added Client Name Version of NVBU Installed Access - Whether or not access is currently available (yes/no). Status - Current Status of the Client (up/ down).

clientgroups

Client Groups

clientstatuses

Client Statuses

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb Recent Error Logs

137

Template File Namea errorlogs

Description of HTML-based Report Prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed pertaining to NVBU error log entries that have occurred in the date range specified. Information includes: Date/Time of Error Log Entry Client - The name of the NVBU Client that the action that generated the error log entry was running on. 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 (for example, error, completed with warnings, etc.) Prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed pertaining to the occurrence of various NVBU events. Information includes: Date/Time of Event Event Name Event Class - The class the selected NVBU 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 Information will be displayed pertaining to any Offline Media 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).

138

Appendix A Running Reports from the CLI


Nice Name Valueb Failed ULA Requests

Template File Namea failedrequests

Description of HTML-based Report All attempted operations in NVBU 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. 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. 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. 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 NVBU event that must occur in order to trigger the selected global notification method. Notification Method - The method of notification used for this global notification (for example, sysop operator message, sysop e-mail, run a job, etc.).

fullonlinemedia

Full Online Media

globalnotifications

Global Notifications

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb

139

Template File Namea historicjobs

Description of HTML-based Report

Historic Jobs Prefaced by a filter dialog box requesting a - By Date 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 Historic Jobs Prefaced by a filter dialog box requesting a - By Size 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 NVBU completed it. Start Time/Date Run Length

historicjobsbysize

140

Appendix A Running Reports from the CLI


Nice Name Valueb

Template File Namea jobdefinitions

Description of HTML-based Report

Defined Jobs Information pertaining to all jobs that have been created in NVBU and saved, but not necessarily run is given (Backup, Restore and Report Jobs). Information includes: Job ID Number Job Title Client Name - The Client on which 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 (for example, 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). Executed Job History Prefaced by a filter dialog box requesting a date range. Once properly given, information pertaining to all NVBU jobs (for example, 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 NVBU 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

jobhistory

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb Blank Media Items In Libraries

141

Template File Namea libraryblankcounts

Description of HTML-based Report The number of blank media items residing in the libraries under control of the current NVBU 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. Information will be displayed pertaining to the media contents of any libraries currently added to the NVBU 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. Prefaced by a filter dialog box requesting a date range. Once properly given, information will be displayed pertaining to NVBU 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 (for example, background, error, information, etc.). Time/Date of Log Entry Client - The name of the NVBU 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).

librarycontents

Libraries' Media Contents

logs

NetVault Logs

142

Appendix A Running Reports from the CLI


Nice Name Valueb Media Contents Query

Template File Namea mediacontentsquery

Description of HTML-based Report 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 NVBU 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).

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb Media General

143

Template File Namea mediageneral

Description of HTML-based Report General information will be revealed pertaining to all media accessible to the NVBU 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). 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 NVBU 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

144

Appendix A Running Reports from the CLI


Nice Name Valueb Media Utilization

Template File Namea mediautilization

Description of HTML-based Report Information will be displayed pertaining to use of all media accessible to the NVBU 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. 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. Information pertaining to any currently offline drives will be displayed. 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 (that is, 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.

notifications

Users' Selected Notifications

offlinedevices outstandingopmsgs

Offline Devices Outstanding Operator Messages

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb

145

Template File Namea overnight_jobs_failed

Description of HTML-based Report

Failed Prefaced by a filter dialog box requesting a Overnight date range. Once properly given, information Backup Jobs 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 NVBU completed it Count Of Failed Overnight Backup Jobs Count Of Successful Overnight Backup Jobs Count of Data Stored In Overnight Jobs A single line of text is created, giving an overall total count of the overnight backup jobs that finished with warnings (for example, 1 backup job finished with warnings). A single line of text is created, giving an overall total count of the overnight backup jobs that finished successfully (for example, 12 backup jobs finished successfully). A single line of text is created, giving an overall total count of the data stored in overnight jobs (for example, Approx. 348GB of data was stored).

overnight_jobs_ failed_count

overnight_jobs_ successful_count

overnight_jobs_ total_data_stored

overnight_jobs_ warnings_count

Count Of A single line of text is created, giving an overall Overnight total count of the overnight failed backup jobs Backup Jobs (for example, 0 backup jobs failed). Finished With Warnings

146

Appendix A Running Reports from the CLI


Nice Name Valueb

Template File Namea policiessummary

Description of HTML-based Report

Policy Basics Basic information pertaining to all policies existing on the NVBU Server will be displayed. Information includes: Policy Name Clients Count - The number of NVBU Clients administered by the selected policy. Job Count - The number of NVBU 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 NVBU 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. Restore Summary Summary information for all restore jobs performed via the current NVBU 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 NVBU completed it. Summary information is displayed pertaining to the capacity of the license for the current NVBU Server. Information includes: Description - A description of the various capacities of an NVBU Server license (for example, number of Clients allowed, largest media capacity supported, number of library units, etc.). Licensed - The level/number allowed for the selected capacity (for example, a specific number, unlimited, etc.). Used - The number actually used in reference to the number allowed in the Licensed column.

restoresummary

serverlicensecapabilities

Server License Capabilities And Usage

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb Server License Flags

147

Template File Namea serverlicenseflags

Description of HTML-based Report A table of data is created giving Yes/No values for the various license-specific functions of NVBU. These values indicate whether or not the current Server license allows for this functionality. 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. 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 NVBU Job specified. Information includes: Date/Time of Log Entry Class - The entrys designated class. Warn Level - The level associated with the selected log entry (for example, background, information, etc.). Client - The name of the NVBU 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). 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 NVBU 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. 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_drives_ events

Single Job's Drive Events

single_job_logs

Single Job's Logs

single_job_media

Media Used by Single Backup

148

Appendix A Running Reports from the CLI


Nice Name Valueb Single Job's Media Transfers

Template File Namea single_job_media_ transfers

Description of HTML-based Report A filter dialog box requesting specific Job ID and Instance numbers. Once properly given, information pertaining to media transfers by this specific NVBU 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 (for example, write). Transferred - The amount of data transferred. Prefaced by a filter dialog box requesting specific Job ID and Instance numbers. Once properly given, detailed information pertaining to this specific NVBU Job will be displayed. This component can be used for any NVBU 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 NVBU 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_ summary

Single Job Main Summary

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb

149

Template File Namea single_job_xfer_ rates

Description of HTML-based Report

Single Job's Prefaced by a filter dialog box requesting a Data Transfer specific jobs Job Identification and Instance Rate 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. Policy Totals 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 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 NVBU Client administered by the named policy. Policy Name - The specified policy. Status - The current status of the NVBU Client.

singlepolicybytecounts

singlepolicyclients

Policy Clients

150

Appendix A Running Reports from the CLI


Nice Name Valueb

Template File Namea singlepolicyfailedjobs

Description of HTML-based Report

Failed Jobs Prefaced by a filter dialog box requesting a Within Single date range and Policy name. Once properly Policy 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 NVBU completed it (for example, Backup Completed with Warnings). Defined Policy Jobs 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 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

singlepolicyjobs

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb

151

Template File Namea singlepolicystatus

Description of HTML-based Report

Policy Status Prefaced by a filter dialog box requesting Information 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 NVBU Clients administered by the selected policy. Job Count - The number of NVBU 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. Single User's Prefaced by a filter dialog box requesting User Audit Trail Account information, a report utilizing this component will give success/failure information in regards to that specific users attempts at various operations in NVBU. User-Defined Information is displayed pertaining to the set Event Types Global Notifications for the currently logged in NVBU user. Information includes: Notify Class - The class designation of the selected global notification. Notify Event - The NVBU 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 (for example, sysop operator message, sysop e-mail, run a job, etc.). Environment - The configured notification environment (if applicable).

singleusersaudittrail

userdefinedeventtypes

152

Appendix A Running Reports from the CLI


Nice Name Valueb User Details

Template File Namea userdetails

Description of HTML-based Report Information pertaining to all user accounts created on the selected NVBU 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. Information is displayed pertaining to each NVBU User Account and its set privileges in NVBU. Information includes: Account Name - The name of the NVBU User Account. Privileges - All privileges currently allowed for the selected User Account. Information is displayed pertaining to each NVBU User Accounts current settings in regards to media quotas and usage. Information includes: Account Name - The name of the NVBU User Account. Media Quota - Level set for media usage for the current user account (for example, 100 GB, Unlimited, etc.). Media Used - The amount of media currently in use by the selected user account. Obtain a list of the Workstation Client backups that have failed. Obtain a list of the Workstation Client backup jobs sorted alphabetically by Workstation Client name.

userprivileges

User Privileges

usersmediausage

Quotas And Media Usage

workstationclientfailedjobs workstationclienthistoricjobsbyclient workstationclienthistoricjobsbydate

Failed Workstation Client Jobs Workstation Client Jobs By Client

Workstation Obtain a list of Workstation Client backup jobs Client Jobs sorted in chronological order with the most By Date recent jobs at the top of the report.

NetVault: Backup Command Line Interface Reference Gude


Nice Name Valueb Workstation Clients Inactive For A Week

153

Template File Namea workstationclientinactiveforaweek

Description of HTML-based Report Obtain a list of the Workstation Clients that have not had a backup attempted for more than seven (7) days.

workstationclientsuccessfuljobs

Workstation Obtain a list of the Workstation Client backups Client that have successfully completed Successful Backup Jobs

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 (Report Component) is named in the Report Component Editor window of the NVBU Console.
Plain Text Template Files

This applies to the 36 canned template files that were created for viewing in the terminal session window (that is, 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, an external file will be created that is comprised of simple plain text. 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, 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 118. 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 (that is, 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, see the section, The Appendoutput Switch on page 156.

154

Appendix A Running Reports from the CLI

A.3.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 NVBU 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 NVBU will create to house the completed report file. This sub-directory, once created, will exist in the ...\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 (that is, 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

Figure A-15: 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 This new subdirectory contains an HTML file that can be opened for viewing the resulting report outside the terminal session window

NetVault: Backup Command Line Interface Reference Gude

155

Additional Considerations
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 existing report sub-directory and the output.html file within will be overwritten with a newly generated version.

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 NVBU 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 NVBU append new report data to the existing report file (see the description of this switch in the section, The Appendoutput Switch on page 156).

HTML-based Template Files will Automatically Copy All Support Files to the New Sub-directory - NVBUs 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:

156

Appendix A Running Reports from the CLI

Navigate to the .../reports/output/<named directory> and Execute the File - Manually navigate to the sub-directory that was created, and launch the file. Launch Output.html Using Browser - Specify the full path to the output.html when viewing report in Browser.

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 (for example, ASCII characters).
Figure A-16: Example of generating external report in Mac OS X environment

A.3.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 (that is, the named sub-directory is removed and replaced, with new report files). In order to maintain the contents in an existing report file, the

NetVault: Backup Command Line Interface Reference Gude

157

-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-17: 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 Considerations

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 (that is, a previous report job must have been created using the -outputdir switch). 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.

158

Appendix A Running Reports from the CLI

Figure A-18: 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-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 template with a different output type, added as a result of the -appendoutput switch

NetVault: Backup Command Line Interface Reference Gude

159

The Title Switch


This switch is briefly discussed in the section, Title Switch on page 132, 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-20: 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 Considerations

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 (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 (that is, the existing report will maintain its existing title).

160

Appendix A Running Reports from the CLI

Appendix B:

Debugging Errors Generated by NVDB Checker


B.1.0 - Debugging Errors Generated by NVDB Checker ............................. 163
B.1.1 - Errors Generated by nvmeddbcheck ..................................................................... 163 B.1.2 - Errors Generated by nvscheddbcheck ................................................................... 166

162

Appendix B Debugging Errors Generated by NVDB Checker

NetVault: Backup Command Line Interface Reference Gude

163

B.1.0

Debugging Errors Generated by NVDB Checker


This appendix describes the symptoms and debug information for the errors generated by the nvmeddbcheck and nvscheddbcheck utilities.

B.1.1

Errors Generated by nvmeddbcheck

LogError Media Manager '%s' table failed raw database check (%ld) This is a serious error; the checker was unable to even check the database tables for simple integrity before moving on to more detailed check. Unless there is some overriding condition (for example, no disk space or memory on the machine), the most likely solution is to recover the last known good NVDB backup and scan in additional backups.

LogInformation Bad segment found A missing segment has been detected; this could be achieved by blanking an individual piece of media from a backup. Database compaction will remove the condition but will not recover the missing segment. Incomplete scanning of the media set associated with a backup stream could also be the cause, in which case all relevant pieces of media need to be scanned in.

LogBackground duplicate xxx entry (Id = %ld, Last Id = %ld) entry out of order (Id = %ld, Last Id = %ld) entry cannot be found (Id = %ld, Last Id = %ld) These entries indicate an internal discrepancy within the NVDB database; as such they do not cause a problem in themselves but indicate that an unknown action occurred which compromised the integrity of the database. Whether that relates to scanning in backups, deleting schedules or backups/ media is unknown. This error indicates that an incomplete database update action occurred because of lack of disk space memory or another reason. It is recommended that the backup logs be reviewed since the last NVDB backup was taken to look for any anomalies. Running a database compaction may help or recovering an previous good NVDB backup may be required.

LogInformation Media Mid from two generations (Id = %ld, Last Id = %ld) Can be caused by the re-use of media, possibly intertwined with an NVDB recovery; this is a benign problem.

164

Appendix B Debugging Errors Generated by NVDB Checker

LogError Internal error walking database table This is a serious error; the checker was unable to even check the database tables for simple integrity before moving on to more detailed check. Unless there is some overriding condition - for example, no disk space or memory on the machine, the most likely solution is to recover the last known good NVDB backup and scan in additional backups.

LogWarning Backup %ld stream %s is incomplete Session with incomplete new streams Backup %ld Job %ld Instance %ld Phase %ld Backup %d is incomplete. Required old streams are missing The information that relates to the backup does not contain all the required information. Run a database compaction to remove the backup from the database and then recover the backup, if required. This is a benign problem.

LogInformation No Session matching Backup Index %ld Backup Index %ld is for a deleted session There is a backup index in the database for which there is no job session record; possibly the index has been scanned in from tape or the jobs have all been deleted. Run a database compaction to remove the backup from the database and then recover the backup, if required. This is a benign problem.

LogInformation Backup %ld has corrupt index file The index file is not readable; it needs to be deleted by hand (the path to the file is now indicated in the log). The index can be scanned in again from the backup device.

LogBackground The saveset index file is offline or missing for %ld backups The index can be scanned in again from relevant backup device.

LogInformation Saveset index files found for %ld deleted backups Index files have been found for unrecorded backup - maybe some backups have been scanned in to recover the index files. Run a database compaction.

NetVault: Backup Command Line Interface Reference Gude

165

LogWarning Failed to check.. There has been a problem in the checking of the database tables; possibly due to lack of resources. This needs to investigated because no checking of the content is able to occur unless basic access is possible. This is similar to a problem with checking the raw integrity of the database. However, it does not necessarily indicate a problem with the database(s).

LogWarning Media Manager database check identified unreferenced records Some problems were identified. Run a database compaction.

LogWarning Failed to compact of media manager database '%s' records Failed to compact media manager database Ordinarily a compaction should run successfully, run nvmeddbcheck manually to identify the problem area.

LogWarning Warning 2008/02/26 05:25:00 1322 Media NetvaultServer Backup 50257 has corrupt index file Re-scan indexes from the backup device or recover a good NVDB, and rescan the additional backups from tape.

LogBackground Check Media table Mid index Media: Mid from two generations (Id = 57328, Last Id = 57224) Can be caused by the re-use of media, possibly intertwined with an NVDB recovery; this is a benign problem. After being marked for re-use, the MID generations will be incremented and when re-used again, incremented again. Normally, the records related to the use of MID would be cleared but there's information in the database that relates to the same MID from different times. Possibly recovering an NVDB or scanning in a duplicated (older) copy of the tape would cause this. It is not a problem.

166

Appendix B Debugging Errors Generated by NVDB Checker

B.1.2

Errors Generated by nvscheddbcheck

LogError Scheduler table '%s' failed raw database check (%ld) This is a serious error; the checker was unable to even check the database tables for simple integrity before moving on to more detailed check. Unless there is some overriding condition (for example, no disk space or memory on the machine), the most likely solution is to recover the last known good NVDB backup and scan in additional tapes.

LogBackground duplicate xxx entry (Id = %ld, Last Id = %ld) entry out of order (Id = %ld, Last Id = %ld) entry cannot be found (Id = %ld, Last Id = %ld) These entries indicate an internal discrepancy within the NVDB database; as such they do not cause a problem in themselves but indicate that an unknown action occurred which compromised the integrity of the database. Whether that relates to scanning in backups, deleting schedules or backups/ media is unknown. This error indicates that an incomplete database update action occurred because of lack of disk space memory or another reason. It is recommended that the backup logs be reviewed since the last NVDB backup was taken to look for any anomalies. Running a database compaction may help or recovering a previous good NVDB backup may be required.

LogError Incomplete database Table not found Incomplete database Table '%s' not found Internal error walking database table Check that an upgrade of an older NVBU installation is not in progress; older NVBU versions would not have as many database tables as 8.0 and later versions and as a result the checker would be expecting to see a table that is not present. If the installation is recent or has been upgraded, then this indicates a serious problem for which the solution is to recover a previous NVDB Scheduler database.

NetVault: Backup Command Line Interface Reference Gude

167

LogInformation Policy '%s' job '%s' uses selections set '%s', that does not exist Policy '%s' job '%s' uses selections set '%s', that could not be loaded Policy '%s' Job '%s' uses plugin '%s', that is not installed Policy '%s' job '%s' uses selections options set '%s', that does not exist Policy '%s' job '%s' uses advanced options set '%s', that does not exist Policy '%s' job '%s' uses target set '%s', that does not exist Policy '%s' job '%s' uses schedule set '%s', that does not exist Policy '%s' job '%s' for client '%s' is implemented by job id %ld, that does not exist Indicates that Selection Sets have been deleted at some time. Either recreate the missing set, or delete the policy which relies on the missing set if no longer active. Recreate/reinstall the client/APM as required.

LogError Failed to walk policies table Failed to get sets table cursor for checking policies Failed to get table cursor(s) to check jobs table Failed to walk jobs table Failed to walk scheduled phases table Failed to walk job instance table Failed to walk instance data table Failed to access Scheduler tables to check references and dependencies This indicates a serious problem for which the solution is to recover a previous good NVDB Scheduler database.

168

Appendix B Debugging Errors Generated by NVDB Checker

LogInformation Scheduled phase id %ld is for job id %ld, that does not exist or has been deleted Run a scheduler database compaction.

LogError Scheduled phase id %ld is for job id %ld that has a corrupt entry in the jobs table This indicates a serious problem for which the solution is to recover a previous good NVDB Scheduler database.

LogInformation Scheduled phase id %ld is for job id %ld instance %ld phase %ld but that job only has %ld phase(s) defined Scheduled phase id %ld is for job %ld instance %ld phase %ld but the previous phases instance data required cannot be found Scheduled phase id %ld is for job id %ld instance %ld that has no instances table entry Recreate the job.

LogWarning Scheduled phase id %ld for job id %ld instance %ld has illegal entry in instances table\n Scheduled phase id %ld for job id %ld instance %ld conflicts with instances table entry (last instance %ld) Recreate the job.

LogWarning Failed to access Scheduler tables to check references and dependencies Run a scheduler database compaction.

LogWarning Scheduler database check identified unreferenced records 1 job instance id records with no job definition 2 change records with no job definition

NetVault: Backup Command Line Interface Reference Gude

169

Both messages are symptomatic of a job that was created and run previously. A Run Now was possibly performed thereafter, and then the job was deleted from the Jobs window. This resulted in the deletion of the job definition related to the instances when the job was run. The job id is not recorded in the log. The Scheduler database should be compacted to remove the warning, which is benign. Running the command line tool nvscheddbcheck Check will indicate the job IDs) in question; if not, then running with TRACE enable will definitely show the job ID.

170

Appendix B Debugging Errors Generated by NVDB Checker

You might also like