?
Solved

vbs script assistance. need help coping logs to a file server.

Posted on 2012-09-05
3
Medium Priority
?
644 Views
Last Modified: 2012-09-10
I am looking for help creating the following script. I need to copy a log file from 30 servers to a file location.

servername1
servername2
servername3
servername4
servername...etc
copy log from
c:\program files\tivoli\tsm\baclient\dsmsched.log

copy file to
\\servername\folder\filename-hostnamedate.log
0
Comment
Question by:SANDDRAGON2004
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 1600 total points
ID: 38370521
create a text file, one server name per line.  Then in a batch file as follows.

@echo off
rem Quick dirty get date depends upon system date.  Choose different formats reliably, see article of mine below.
set d=%date:/=-%
set source=\c$\program files\tivoli\tsm\baclient\dsmsched.log
set dest=\\servername\folder\filename

for /f %%a in (servers.txt) do copy /y "\\%%a\%source%" "%dest%-%%a-%d%.log"


http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_1153-Using-dates-in-batch-files-scripts.html#3225
0
 

Author Comment

by:SANDDRAGON2004
ID: 38384744
thank you! I have been racking my brain with this stuff.  much appreciated man!
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 38384838
No problem, glad it helped.

Steve
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

588 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