Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell NetWorker 19.9 Administration Guide

Example backup script on Windows

In this example backup script for a Windows client computer, the customized backup program runs pre-backup commands, the NetWorker save command, and then post-backup commands.

Description of the example script

The following table provides details on each type of command in the example backup script.

Table 1. Example backup script on Windows
Command type Description
Pre-backup Redirects the output of the net start DOS command to create a netstart.txt file at the root of the C:\ drive, and sends all information about started services for the current computer to this file.
save Runs NetWorker commands that are required to start the backup process.
Post-backup Redirects the output of the set DOS command to a set.txt file at the root of the C:\ drive, and sends all computer system environment information to this file.

The netstart.txt and set.txt files are placed in the C:\directory. New information is appended to these files each time a backup is run.

Example script

@ECHO OFF
SETLOCAL
ECHO =======START BATCH FILE================
ECHO =====NetWorker PRE_BACKUP COMMAND======
ECHO =======NET START - creates netstart.txt file and
ECHO =======sends all Started Services information 
ECHO =======to the file c:\netstart.txt

NET START >>C:\NETSTART.TXT

REM This command takes incoming arguments from
REM the savegrp command and handle them
REM to overcome batch file limitations: 

REM PARSE ALL INCOMING ARGUMENTS 
REM and pass single argument in case
REM more than 10 arguments are passed to this file
REM (ie %0-%9 is not enough).

ECHO =====NetWorker SAVE SET COMMAND=======
SHIFT
SET arg=%0

:loop
SHIFT
IF %0.==. GOTO save
SET arg=%arg% %0
GOTO loop

REM These are the save commands that run the required 
REM NetWorker backup commands.

:save

REM Note: Enter correct path to your NetWorker bin 
REM directory (line below is default path)
C:\PROGRA~1\nsr\bin\save.exe %arg%

ECHO =====NetWorker POST_BACKUP COMMAND====
ECHO ====="SET" - creates set.txt file and sends all 
ECHO =====computer system environment information to
ECHO =====C:\set.txt file========

SET >>C:\SET.TXT

ECHO ======END OF BATCH FILE====

ENDLOCAL

Monitoring details for the script

The following information appears in the Monitoring window of the Administration interface and the backup action log file. After the backup process completes, review the log output to verify the execution of the commands in the script.

--- Successful Save Sets ---
:* jupiter:c:\inetpub =======START BATCH FILE============
* jupiter:c:\inetpub ===NetWorker PRE_BACKUP COMMAND===
* jupiter:c:\inetpub=======NET START 
* creates netstart.txt file and sends all started
* jupiter:c:\inetpub ======services information to 
* that file c:\netstart.txt== 

* jupiter:c:\inetpub ===NetWorker SAVE SET COMMAND====
* jupiter:c:\inetpub save: using `C:\Inetpub' for
* `c:\inetpub'
jupiter: c:\inetpub level=full,194 KB 00:00:02 37 files
* jupiter:c:\inetpub =====NetWorker POST_BACKUP COMMAND
* jupiter:c:\inetpub ====="SET" - creates set.txt 
* file and sends all computer system 
* jupiter:c:\inetpub ==== environment information 
* to C:\set.txt file
* jupiter:c:\inetpub ======END OF BATCH FILE====



Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\