Solved

can't robocopy to the multible servers

Posted on 2006-07-01
8
300 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 83

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 83

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 83

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

823 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