Need some help with batch script – redirect output into text file
Home › Forums › Scripting › General Scripting › Need some help with batch script – redirect output into text file
- This topic has 7 replies, 2 voices, and was last updated 9 years, 8 months ago by
beddo.
-
AuthorPosts
-
igor7MemberMay 23, 2011 at 12:56 am #154742Hi, everyone!!
We have NetBackup application running on W2003K server to backup all clients data on tapes. Netbackup software has useful applets that can be executed from command line. Using those applets I can check for example images expiration time on particular cassette, tape properties… etc. And it’s very conveniently to use those command in batch scripts…
For example this script use input method and it can check content of particular tape (all backup images stored on it):
[COLOR=#0000ff]@echo off
echo.
echo Please insert tape ID bellow:
echo.
:input
set INPUT=
set /P INPUT=Type input: %=%
if “%INPUT%”==”” goto input
cd c:program filesveritasnetbackupbinadmincmd
bpimmedia -mediaid %INPUT% -L
pause[/COLOR]
[/CODE][COLOR=black]And this script also used input method, it can check information about a particular media in database:[/COLOR]
[COLOR=#000000][/COLOR]
[COLOR=#0000ff][CODE]
[COLOR=#0000ff]@echo off
echo.
echo Please insert tape ID bellow:
echo.
:input
set INPUT=
set /P INPUT=Type input: %=%
if “%INPUT%”==”” goto input
cd C:program filesveritasnetbackupbinadmincmd
bpmedialist -mlist -U -m %INPUT%
pause[/COLOR]
[/CODE][COLOR=black][COLOR=black][FONT=Verdana]When I need to check few tapes it’s ok. But real hard work is came if I need to check whole weekly or monthly policy on different servers (each one contains about 40 tapes)… So question is if it possible to improve scripts that are using input method to read tapes info from text file and redirect output into another text file?[/FONT][/COLOR][COLOR=blue][FONT=Verdana][/FONT][/COLOR]
[COLOR=black][FONT=Verdana]Thank you in advance,[/FONT][/COLOR][COLOR=blue][FONT=Verdana][/FONT][/COLOR]
[COLOR=black][FONT=Verdana]Igor[/FONT][/COLOR][COLOR=blue][FONT=Verdana][/FONT][/COLOR]
[/COLOR][COLOR=#000000][/COLOR]
[COLOR=#000000][/COLOR][/COLOR]
[/COLOR][CODE]
@echo off
echo.
echo Please insert tape ID bellow:
echo.
:input
set INPUT=
set /P INPUT=Type input: %=%
if “%INPUT%”==”” goto input
cd c:program filesveritasnetbackupbinadmincmd
bpimmedia -mediaid %INPUT% -L
pause
[/CODE]And this script also used input method, it can check information about a particular media in database:
[COLOR=#0000ff]@echo off
echo.
echo Please insert tape ID bellow:
echo.
:input
set INPUT=
set /P INPUT=Type input: %=%
if “%INPUT%”==”” goto input
cd C:program filesveritasnetbackupbinadmincmd
bpmedialist -mlist -U -m %INPUT%
pause[/COLOR]
[/CODE][COLOR=black][COLOR=black][FONT=Verdana]When I need to check few tapes it’s ok. But real hard work is came if I need to check whole weekly or monthly policy on different servers (each one contains about 40 tapes)… So question is if it possible to improve scripts that are using input method to read tapes info from text file and redirect output into another text file?[/FONT][/COLOR][COLOR=blue][FONT=Verdana][/FONT][/COLOR]
[COLOR=black][FONT=Verdana]Thank you in advance,[/FONT][/COLOR][COLOR=blue][FONT=Verdana][/FONT][/COLOR]
[COLOR=black][FONT=Verdana]Igor[/FONT][/COLOR][COLOR=blue][FONT=Verdana][/FONT][/COLOR]
[/COLOR][COLOR=#000000][/COLOR]
[COLOR=#000000][/COLOR][/COLOR]
[/COLOR][CODE]
@echo off
echo.
echo Please insert tape ID bellow:
echo.
:input
set INPUT=
set /P INPUT=Type input: %=%
if “%INPUT%”==”” goto input
cd C:program filesveritasnetbackupbinadmincmd
bpmedialist -mlist -U -m %INPUT%
pause
[/CODE]When I need to check few tapes it’s ok. But real hard work is came if I need to check whole weekly or monthly policy on different servers (each one contains about 40 tapes)… So question is if it possible to improve scripts that are using input method to read tapes info from text file and redirect output into another text file?
Thank you in advance,
Igor
-
AuthorPosts
You must be logged in to reply to this topic.