Dell DR4300e NetVault Backup - Best Practices for Setting up VTL Containers an - Page 49

NetVault Backup nVTL ghost media scrub script

Page 49 highlights

NetVault Backup nVTL ghost media scrub script Windows® platform @echo off Setup Vars set nvutil=%ProgramFiles(x86)%\Dell\NetVault Backup\util setlocal enabledelayedexpansion set logfile=%tmp%\logdd430-1purge.log set "media_prefix Capture Vars input CLS set /p media_prefix=Enter the Media Label Prefix to Purge (enter . to exit): IF "%media_prefix%"=="." GOTO :eof IF "%media_prefix%"=="" GOTO input Begin Works echo Stage 1 - Begin: Setup Logging @echo. > "%logfile%" @echo. >> "%logfile%" @echo logfile%" @echo Start DD Media Start>> "%logfile%" date/t >> "%logfile%" time/t >> "%logfile%" @echo logfile%" echo Stage 1 - Completed: Log file created Look for all medias in the library with label prefix :: and delete media from the Database echo Stage 2 - Begin: Capture Media to be processed for deletion "%nvutil%\nvreport.exe" -class "media" -exclude "%%LIBRARYSTATUS = Online" -format "%%Label" -sort "%%Label" | find "%media_prefix%" > "%tmp%\~mediapurge.txt" echo The following media will be processed for deletion: type "%tmp%\~mediapurge.txt" echo Stage 2 - Completed: Capture Media Media List has been defined echo Stage 3 - Begin: Process all Media for Deletion from the Media Database FOR /F "tokens=1 delims= " %%i IN (%tmp%\~mediapurge.txt) DO ( SET ML=%%i call :_expire %%i ) echo Stage 3 - Completed: Processed all Media for Deletion from the Media Database echo Stage 4 - Begin: Clean up from works completed\ if exist "%tmp%\~mediapurge_old.txt" erase "%tmp%\~mediapurge_old.txt" ren %tmp%\~mediapurge.txt ~mediapurge_old.txt echo Stage 4 - Completed: Clean up complete goto :eof :_expire @echo echo Delete Media with Label %ML% @echo Delete Media with Label %ML% >> "%logfile%" @echo echo "%nvutil%\nvremovemedia.exe" -medialabel "%ML%" "%nvutil%\nvremovemedia.exe" -medialabel "%ML%" goto :eof 49 Best practices for setting up Dell VTL Container or NetVault Backup native virtual tape library (nVTL)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52

Best practices for setting up Dell VTL Container or NetVault Backup native virtual tape library (nVTL)
49
NetVault Backup nVTL ghost media scrub script
Windows
®
platform
@echo off
:: ====================================================================
:: Setup Vars
:: ====================================================================
set nvutil=%ProgramFiles(x86)%\Dell\NetVault Backup\util setlocal enabledelayedexpansion
set logfile=%tmp%\logdd430-1purge.log set “media_prefix=”
:: ====================================================================
:: Capture Vars
:: ====================================================================
:input
CLS
set /p media_prefix=Enter the Media Label Prefix to Purge (enter . to exit): IF “%media_prefix%”==”.” GOTO
:eof
IF “%media_prefix%”==”” GOTO input
:: ====================================================================
:: Begin Works
:: ====================================================================
echo Stage 1 - Begin: Setup Logging
@echo. > “%logfile%”
@echo. >> “%logfile%”
@echo ======================================================== >>”%logfile%”
@echo Start DD Media Start>> “%logfile%” date/t >> “%logfile%”
time/t >> “%logfile%”
@echo ======================================================== >>”%logfile%” echo Stage 1 - Completed:
Log file created
::
::
:: ================================================
:: Look for all medias in the library with label prefix
:: and delete media from the Database
:: ================================================”
echo Stage 2 - Begin: Capture Media to be processed for deletion
“%nvutil%\nvreport.exe” -class “media” -exclude “%%LIBRARYSTATUS = Online” -format “%%Label” -sort
“%%Label” |
find “%media_prefix%” > “%tmp%\~mediapurge.txt”
echo The following media will be processed for deletion:
type “%tmp%\~mediapurge.txt”
echo Stage 2 - Completed: Capture Media Media List has been defined
echo Stage 3 - Begin: Process all Media for Deletion from the Media Database
FOR /F “tokens=1 delims= “ %%i IN (%tmp%\~mediapurge.txt) DO ( SET ML=%%i
call :_expire %%i
)
echo Stage 3 - Completed: Processed all Media for Deletion from the Media Database echo Stage 4 - Begin:
Clean up from works completed\
if exist “%tmp%\~mediapurge_old.txt” erase “%tmp%\~mediapurge_old.txt”
ren %tmp%\~mediapurge.txt ~mediapurge_old.txt
echo Stage 4 - Completed: Clean up complete goto :eof
:_expire
@echo ===========================================
@echo Delete Media with Label %ML%
@echo Delete Media with Label %ML% >> “%logfile%”
@echo =========================================== echo “%nvutil%\nvremovemedia.exe” -medialabel “%ML%”
“%nvutil%\nvremovemedia.exe” -medialabel “%ML%”
goto :eof