Solved

robocopy

Posted on 2014-02-20
6
507 Views
Last Modified: 2014-03-03
At work they disabled offline folders, so i thought i would make a simple batch file and put it in the startup folder, and try to find a way to have it run when i log off.
so far i have this in my batch file
cd \

robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff

robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs

pause

I started with the first robocopy line, and it worked fine. so i added the second line, and now it only runs the second line.
is there a way to have it run the first line, then the second line? eventually i will have about 5 robocopy lines for the different folders i want to "sync"
By the way, i have the pause there to make sure it works, once it's running fine, i will take it out.
0
Comment
Question by:JeffBeall
[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
6 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 39874914
Why do IT people disable this stuff and not give their users alternatives.... like saying you've got a 100Mb home drive, no access to C: drive, USB ports disabled for storage devices and no DVD drive in laptop.... some users get inventive and make their own solutions, others constantly delete stuff and keep wanting accidentally deleted stuff restored.

Anyway back to your q, not quite sure what you mean about running one line then the next, it will do that anyway?  You haven't called the batch file robocopy.cmd have you so the next robocpy command calls the batch file again?

Steve
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 39874997
I agree, I really like the offline files,

to answer your question,

It seems like it isn't running each line in sequence because it shows the copy statistics, and for the first line there is about 200 files copied, and for the second line there is only 22 files. in the statistics, after running it the first time, it showed that 200 files were skipped, which is good because there was no change to these files. then when i added the second line, and ran it a second time, it shows only 20 files are skipped.
So as a test I made a change to a file that would be located in the first robocopy line. but when i run the batch file, it still shows nothing copied and 22 files skipped.
as far as calling the batch file, no, all i have is

cd \

robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff

robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs

pause
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 39875265
If you add to the commands a log we can see better what is happening maybe.... if you have changed a file in H: then the /MIR should pickup that change and sync it to the c: copy OK.



@echo off
set log =c:\syncfolders\mylog.txt
robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff /tee /log:%log%
robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs /tee /log+:%log%

pause 

Open in new window

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Author Closing Comment

by:JeffBeall
ID: 39881281
thank you for the help
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 39881366
No problem, did you get it working then or the log throw anything up?

Steve
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 39900413
sorry it's been such a slow responce, I ended up re-doing the batch file.
I think the most significant difference on the new batch file was putting quotes around all the paths in each robocopy statements, and adding the /fft switch. So it looks like this now.

cd \

robocopy /MIR /fft /XO "H:\Computer stuff" "C:\syncfolders\compstuff"

robocopy /MIR /fft /XO "H:\MyDocs" "C:\syncfolders\mydocs"

robocopy /MIR /fft /XO "H:\MyDocuments" "C:\mydocuments"

robocopy /MIR /fft /XO "H:\Printer Stuff" "C:\printerstuff"

It seems to be working now. Thank you again for all your help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses

632 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