cancel
Showing results for 
Search instead for 
Did you mean: 

batch file on muliple servers, need muliple output files

dvendt
Level 2

Hi,

I have this small batch file that I use to check daily backups on muliple servers, the issue is, if the backup did not run, it will not show on the output, I guess the command doesn't show any backups that do not run, just shows "no entity was found".

So, what I thought was to run the same command, but, unlike 1 output file for all servers that I have now, create a separate output file for each server, have the output append daily and then I can trend out the backups over time.

I am using a text file that has the name of the clients.

I want to run this command on muliple servers and have a separate output file for each server.

Here is what I am using now that works, 1 output file for all servers, I want one output file for each server, can you assist?

Thanks! -Dom


For /f %%i in (servers.txt) do  bpimagelist -idonly -client %%i >>"\\servername\sharename\daily servers_backup_report_%date:~10,4%-%date:~4,2%-%date:~7,2%.txt"

 

 

3 REPLIES 3

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

 

you can probably try the below one...just small modification, so separeate file for each client.

For /f %%i in (servers.txt) do  bpimagelist -idonly -client %%i >>"\\servername\sharename\%%i_backup_report_%date:~10,4%-%date:~4,2%-%date:~7,2%.txt"

 

dvendt
Level 2

Yes, that works, thanks, one additional question.

I have muliple nbu master server environment, can I run the bpimagelist command from one master and report on another master? I tried this,

bpimagelist -M <servername> -idonly -client <clientname>

but this is the result

"operation requested by an invalid server"

 

What am I  doing wrong?

Thanks! -DOm

 

Marianne
Level 6
Partner    VIP    Accredited Certified

In order to run command on different master, you need SERVER entries for each other.

Ensure reverse lookup is able to resolve IP to hostname that is in SERVER list.