beautypg.com

Linux /unix platform bash script – Dell PowerVault DR2000v User Manual

Page 55

background image

55

Setting up NetVault Backup Native Virtual Tape Library on the Dell™ DR4X00 Disk Backup
Appliance

:: ******************************************************

:_clean

@echo ===========================================

@echo Clean Media with Label %ML%
@echo Clean Media with Label %ML% >> "%logfile%"

@echo ===========================================

:: ==============================================

:: Open and close I/O Port, to remove a

:: remaining media, wait 5 seconds

:: ==============================================
@echo "%nvutil%\nvopeneeport.exe" -libraryname "%library_name%"

"%nvutil%\nvopeneeport.exe" -libraryname "%library_name%"

choice /T 5 /C jn /N /D j >NUL:

"%nvutil%\nvcloseeeport.exe" -libraryname "%library_name%"

choice /T 5 /C jn /N /D j >NUL:

echo Stage 3 - Completed
::

::

:: ==============================================

:: Export expired media and open

:: I/O Port. Library cannot load media

:: into a drive anymore

:: ==============================================
echo "%nvutil%\nvexportmedia.exe" -barcode %ML%

"%nvutil%\nvexportmedia.exe" -barcode %ML%

choice /T 5 /C jn /N /D j >NUL:

"%nvutil%\nvopeneeport.exe" -libraryname "%library_name%"

echo Stage 4 - Completed

::
::

:: ===============================================

:: Media is now unreachable for the library

:: in I/O Slot, now we cheat NetVault !

::

:: For security reasons: Rename old media first
:: After that, create new media with old name

:: Deletion in next step

:: ===============================================

if exist "%vtlpath%\media\%ML%.disabled" erase "%vtlpath%\media\%ML%.disabled"

ren "%vtlpath%\media\%ML%" %ML%.disabled

"%nvutil%\nvmakemedia.exe" %media_size% mediafiles "%vtlpath%\media\%ML%"

"%nvutil%\nvcloseeeport.exe" -libraryname "%library_name%"
choice /T 5 /C jn /N /D j >NUL:

echo "%nvutil%\nvblankmedia.exe" -barcode %ML% -wait

"%nvutil%\nvblankmedia.exe" -barcode %ML% -wait

if %GL% == None ("%nvutil%\nvlabelmedia.exe" -barcode %ML% -newlabel %ML%) else ("%nvutil%\nvlabelmedia.exe" -barcode

%ML% -newlabel %ML% -newgroup %GL%)

if exist "%vtlpath%\media\%ML%.disabled" erase "%vtlpath%\media\%1.disabled"
choice /T 5 /C jn /N /D j >NUL:

echo Stage 5 - Completed

goto :eof

echo Stage 6 - Completed

Linux /Unix Platform Bash Script:

#!/bin/bash
# ==================================================================

# The following parameters must be configured for the script example provided as follows:

# vtlpath = This should be the UNC path of the root share used to host the nVTL instance.

# media_prefix = This should be the prefix of the vitual media designated for processing

# library_name = This should be the name of the library as it has been added to NetVault Backup

# media_size = This is the size of the media to be recreated and must be compatibly for input to the

# nvmakemedia command
# ===================================================================

nv_home=`head -n -1 /etc/.nv6_home`

nvutil=$nv_home/util

media_size=50m