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

x
?
Solved

can't robocopy to the multible servers

Posted on 2006-07-01
8
Medium Priority
?
311 Views
Last Modified: 2008-02-01
I'm trying to copy a file with the following small script,but it's not working.What's wrong with it ?Nothing happens when it is run.

Basically,I want to do is :

Copy *.XDB file
FROM C:\Scripts\SAVscripts TO   all the servers that I have in LatestXDB.txt file.
Destination on these servers is \\%%i\C$\Program Files\SAV
Finally create a log file for the result in C:\Scripts\SAVscripts\Logs\


Here is the small script that I'm using :

FOR /F %%i in (D:\Support\scripts\symantec\LatestXDB.txt) do robocopy.exe "C:\Scripts\SAVscripts" "\\%%i\C$\Program Files\SAV" *.xdb /w:1 /r:1 /zb /V /LOG+:C:\Scripts\SAVscripts\Logs\LatestXDB.log

I do have full access on the destination folders.
Any comment?
Thanks

0
Comment
Question by:shebnem
  • 3
  • 3
8 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 17026358
My guess is that LatesXDB.txt is saved in unicode; the "for" command can't handle this. Either save it in ANSI (open in notepad, "Save as", choose ANSI in the dropdown menu), or use 'type LatestXDB.txt' in the for loop:
FOR /F %%i in ('type "D:\Support\scripts\symantec\LatestXDB.txt"') do robocopy.exe "C:\Scripts\SAVscripts" "\\%%i\C$\Program Files\SAV" *.xdb /w:1 /r:1 /zb /V /LOG+:C:\Scripts\SAVscripts\Logs\LatestXDB.log
0
 

Author Comment

by:shebnem
ID: 17026809
I've tried both,didn't work unfortunatelly.
Thanks for the suggestion anyway...
0
 
LVL 85

Expert Comment

by:oBdA
ID: 17026836
Anything in the log file?
Put an "echo" in front of robocopy.exe, run the script again and check if the correct commands are listed.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:shebnem
ID: 17027161
I've checked the log files,nothing specific to this job.
I've put an "echo".It just  appears for a sec and disappears.
0
 
LVL 85

Expert Comment

by:oBdA
ID: 17027941
Seems like you looked in the event log? I was talking about the "LatestXDB.log" file; is it created, and if so, is there something in it?
In addition, you can add a "/tee" (verify this, I'm not completely sure it's the correct one) to the options, which will display robocopy's output on the screen as well as in the log file.
When testing batch scripts, always run them from a command window, not by double-clicking them in Explorer, it's easier to see error messages.
You can add a "pause" at the end to stop the command window from closing after being started from Explorer, but this will help you nothing if the script errors out before it reaches the pause command, so go for the first solution.
0
 

Author Comment

by:shebnem
ID: 17039721
One of my friend found out what the problem is.Here is the correct line :

FOR /F %%i in (D:\Support\scripts\symantec\XDBdelivery\LatestXDB.txt) do robocopy.exe "\\cmvismon1\c$\Scripts\SAVscripts" "\\%%i\VPHOME" *.XDB /w:1 /r:1 /zb /tee /V /LOG+:D:\Support\scripts\symantec\XDBdelivery\LatestXDB.log



and changed the permissions on shares.It worked great.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 17076056
Closed, 125 points refunded.
Netminder
Site Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline

885 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