Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Create a script to copy .opt file from multiple servers to one location

Posted on 2011-03-03
4
Medium Priority
?
563 Views
Last Modified: 2012-06-21
Throughout our enterprise we have 400+ Windows 2003 and 2008 servers that use Tivoli® Storage Manager to backup files and directories.
Each server has an options file named dsm.opt  in the following location:
 C:\Program Files\Tivoli\TSM\baclient\dsm.opt
I would like to create a script that would
1. Pull server name from server.txt file(our server names all have hyphens in the name
2. Copy dsm.opt file from the following path
     a. \\ServerName\c$\Program Files\Tivoli\TSM\baclient
3. Copy to Server or PC I am running Script from
     a. Create a folder with the server name and copy the .opt file to that folder.

I have zero scripting experience, any help would be appreciated.
Thanks - brewersewer
0
Comment
Question by:brewersewer
  • 2
4 Comments
 

Author Comment

by:brewersewer
ID: 35030938
Thanks.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 35031422
Something like this?
@echo off
setlocal
for /f %%a in ('type server.txt') do (
  if not exist "%~dp0%%a" md "%~dp0%%a"
  copy "\\%%a\C$\Program Files\Tivoli\TSM\baclient\dsm.opt" "%~dp0%%a\dsm.opt"
)

Open in new window

0
 

Author Closing Comment

by:brewersewer
ID: 35037632
Worked perfectly - Thanks for your help.
0
 

Expert Comment

by:gihrnm
ID: 35473121
Mine is a slight variation from this one. Perfect.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question