Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

can't robocopy to the multible servers

Posted on 2006-07-01
8
Medium Priority
?
310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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