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

x
?
Solved

using Robocopy

Posted on 2011-02-16
6
Medium Priority
?
416 Views
Last Modified: 2012-05-11
Hi,
I am using Robocoy to copy files inbetween our differenent locations.  Working well.  I need to know the switches to put on so that robocopy copies only files that have changed or any new ones added once the full copy is already run on a particular folder to save time and bandwidth.
At the moment I am using
robocopy souce destination /MIR /SEC
Help plz
0
Comment
Question by:amanzoor
  • 2
  • 2
  • 2
6 Comments
 
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 1000 total points
ID: 34907648
As I understand it, the way you're using it should work the way you want it to.
0
 
LVL 23

Accepted Solution

by:
jakethecatuk earned 1000 total points
ID: 34907766
if you use /MIR, then files that no longer exist on the source will get purged from the destination - is that what you want?

also, you will not copy over any subfolders with your current syntax - consider adding /E if you want subfolders as well (I always put it in just in case folders get created)

adding /ZB should help avoid any access problems that you may come up against - can hepl with locked files.

adding /R:1 /W:1 will retry once and wait 1 second before trying again - useful with locked files.

/tee /log:{filename} will output what's going on to a file as well as a screen.

aside from that, your original command will work fine.
0
 
LVL 4

Author Comment

by:amanzoor
ID: 34907777
one more thing:  I am calling my script which is bak.bat from windows task schedular on server 2008.  Is there a way once the script is called by task schedular, it should actually show me the Dos window on screen where its running the files which are copied?
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 34907836
I think that will only happen if you're logged in as the user whose credentials are being used to launch the script.  That is, if you're logged in as administrator, and you're using the administrator account to run the batch file, you may see the command prompt.  Don't hold me to that.
0
 
LVL 23

Expert Comment

by:jakethecatuk
ID: 34907847
As I mentioned before, the '/tee /log:{filename}' command may help you as it will output what's going on to a file as well as a screen.  If you don't want it to screen, drop the '/tee' bit.
0
 
LVL 4

Author Closing Comment

by:amanzoor
ID: 34909149
Thanks Gentlemen, I really appreciate your time.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

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