Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

savegrp report

Status
Not open for further replies.

jamesterra

Technical User
Dec 5, 2002
4
ES
Hi.

If I run savegrp command manually, how can I send the log of the backup to a specific file?
I want to generate a diferent log files, one for each group.

Regards.

James.
 
Just redirect the output from standard out to a textfile:

savegrp -vv [your options] > [path]\groupname.txt 2>&1

Cheers!
Maverick
 
Thanks for oyur help,
but I don´t want to use the verbose option; then the standard out is null.
Any suggestions?

Regards...
James
 
You can use notification.
In the Savegroup completion you can put a script in the action field.
You can use a script like:
@SET HOME=C:
@SET FILE_NOTIFICA=%HOME%\Notifica_Gruppi.txt
@SET FILE_SEMAFORO_VERDE=%HOME%\verde.txt
@SET FILE_SEMAFORO_ROSSO=%HOME%\rosso.txt

@SET PRIMA_LINEA=%HOME%\PRIMA_LINEA.txt
@SET SECONDA_LINEA=%HOME%\SECONDA_LINEA.txt
@SET TERZA_LINEA=%HOME%\TERZA_LINEA.txt

@IF EXIST %PRIMA_LINEA% del %PRIMA_LINEA%
@IF EXIST %SECONDA_LINEA% del %SECONDA_LINEA%
@IF EXIST %TERZA_LINEA% del %TERZA_LINEA%
@IF EXIST %FILE_SEMAFORO_VERDE% del %FILE_SEMAFORO_VERDE%
@IF EXIST %FILE_SEMAFORO_ROSSO% del %FILE_SEMAFORO_ROSSO%

@more > %FILE_NOTIFICA%

@type %FILE_NOTIFICA% | find "Savegroup" > %PRIMA_LINEA%

@FOR /F "eol=; tokens=4 delims=, " %%i in (%PRIMA_LINEA%) do @SET GRUPPO=%%i

@FOR /F "eol=; tokens=8,9 delims=, " %%i in (%PRIMA_LINEA%) do @SET STATUS=%%i%%j

@type %FILE_NOTIFICA% | find "Start time" > %SECONDA_LINEA%

@FOR /F "eol=; tokens=3,4,5,6* delims=, " %%i in (%SECONDA_LINEA%) do @SET START=%%j %%k %%l

@type %FILE_NOTIFICA% | find "End time" > %TERZA_LINEA%

@FOR /F "eol=; tokens=3,4,5,6* delims=, " %%i in (%TERZA_LINEA%) do @SET STOP=%%j %%k %%l

@IF %STATUS%==(AllSucceeded) (

@SET SUBJECT="ESITO GRUPPO %GRUPPO% POSITIVO : START = %START% : END = %STOP%"
@copy %FILE_NOTIFICA% %FILE_SEMAFORO_VERDE%

) ELSE (

@SET SUBJECT="ESITO GRUPPO %GRUPPO% NEGATIVO : START = %START% : END = %STOP%"
@copy %FILE_NOTIFICA% %FILE_SEMAFORO_ROSSO%

)
@blat %FILE_NOTIFICA% -s %SUBJECT% -t %LISTA%

Bye.
 
Owesome script, you got me completely lost, what ever it does good to just look at it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top