locked
Robocopy Question RRS feed

  • Question


  • Hello;

    I am using WHS and I have created a shared folder called Office Image Files. The Office client is an XP machine.

    I am trying to use Robocopy GUI 3.1 to copy/sync the files from the Office client PC Image Files folder to the WHS shared folder. I have ran tests with Robocopy GUI and I can see that the folder/files are being copied and synced OK. I have saved a Robocopy script cmd file to accomplish the copy/sync.

    Instead of using using Windows Scheduler to run the the Robocopy script cmd file every few hours is there a way to have Robocopy run all the time in the background with the /Mon:n and MOT:m switches to make Robocopy monitor the source folder "Office Image Files" to copy/sync the files in "almost real time" to the WHS shared folder when the source files change.

    Thanks!

    Best Regards, Bill Artman Kansas City - USA
    Tuesday, September 9, 2008 8:34 PM

Answers

  • That's what the /MON and /MOT parameters are for. However, they trigger robocopy to rerun the file copy operation defined by the other parameters, which could take a while.

    There are hundreds of references for robocopy online, such as this one.

    I'm not on the WHS team, I just post a lot. :)
    Wednesday, September 10, 2008 11:33 AM
    Moderator

All replies

  • That's what the /MON and /MOT parameters are for. However, they trigger robocopy to rerun the file copy operation defined by the other parameters, which could take a while.

    There are hundreds of references for robocopy online, such as this one.

    I'm not on the WHS team, I just post a lot. :)
    Wednesday, September 10, 2008 11:33 AM
    Moderator


  • Ken;

    Thanks for your reply.  I understand what you are saying and I already have looked at the link you gave which gives good information.  As you say, the /MON and /MOT make Robocopy monitor the source folder for changes, etc. but my question is how do I make Robocopy active or run all the time 24/7 in the background so it will monitor the source folder?

    The only way I know how to make Robocopy run is one instance at a time either by using Windows scheduler, by using Robocopy GUI or by using the Command Line.

    Thanks again!

    Best Regards, Bill Artman Kansas City - USA
    Wednesday, September 10, 2008 1:42 PM
  • When you use the /MON or /MOT parameter, it should stay resident in memory. I haven't used those parameters in years, though, so I honestly don't recall if robocopy requires you to leave the command prompt you started it from open.

    And (as I implied above) you probably want to do something more sophisticated than /MIR if you're using /MON or /MOT. /MIR is the equivalent of /PURGE and /E.

    I'm not on the WHS team, I just post a lot. :)
    Wednesday, September 10, 2008 2:42 PM
    Moderator

  • Ken;

    When I am using Robocopy GUI it never occurred to me that when I check the box for /MON and /MOT then close out of the GIU that those parameters might stay resident in memory.  I will have to test that to see.

    I am a photographer using PhotoShop to prepare my image files for my lab.  I would like to have Robocopy monitor the PhotoShop images folder and copy any changed file to my WHS shared folder.  Then at a time in the future when I delete an image file from the PhotoShop folder (source) I want Robocopy to recognize the file deletion and delete that same file from the WHS shared folder.  I am still doing the nightly WHS backup of the client PC but by using Robocopy I will have a copy of any changed image files which occurs before the nightly backup in case the client hard drive fails.

    With that said, regarding your last sentence - I am of the impression that if I only use the /Mir (mirror) parameter which is the same as you state equivalent of /PURGE and /E won't running /Mir with /MON and /MOT accomplish what I am trying to do?

    I am missing something?  Thanks again for all of your help!





    Best Regards, Bill Artman Kansas City - USA
    Wednesday, September 10, 2008 3:45 PM
  • /MIR with /MON is a bad idea:

    Say you have /MIR /MON:10. When robocopy detects 10 changes, it will fire off it's copy again (/MIR). /MIR effectively purges everything in the destination (/PURGE), then copies everything over again, including empty directories (/E). So every time 10 files change, you're copying the whole thing all over again. With a lot of data, this can take a long time.

    Personally, I don't back up work in process in any way. It's annoying to lose it, but it's a couple of days of annoying, not multiple months. Originals and final product are both stored on multiple media, including my server. Originals go straight to the server; I have Bridge save a copy there (even though it's slow as molasses). Finals go to the server when I'm done.

    I'm not on the WHS team, I just post a lot. :)
    Wednesday, September 10, 2008 4:59 PM
    Moderator


  • Ken;

    Thanks for explaining /MIR with /MON further.  I thought that only new/changed files could be copied and that the destination files would only be deleted when the source folder files were deleted.

    I agree with you that /MIR with /MON is not good!  Thanks again for taking the time to explain this to me.

    Have a great week!

    Best Regards, Bill Artman Kansas City - USA
    Wednesday, September 10, 2008 5:17 PM
  • Actually, it's not quite so invasive as it sounds. But still, if your initial robocopy run takes 10 minutes, every time it fires off due to changes it will take another 10 minutes to finish.
    I'm not on the WHS team, I just post a lot. :)
    Wednesday, September 10, 2008 5:22 PM
    Moderator
  • Bill,
    You need to check into using the 'X' options, these cover exclusions, so can be chained if necessary.

    Colin
    If anyone answers your query successfully, please mark it as 'Helpful', to guide other users.
    Wednesday, September 10, 2008 5:25 PM
    Moderator


  • Ken and Colin;

    Thanks for your info!

    Best Regards, Bill Artman Kansas City - USA
    Wednesday, September 10, 2008 5:30 PM
  • Bill,

    I haven't used it, but the GUI for RoboCopy might be worth looking at if it's flexible enough.

    Colin
    If anyone answers your query successfully, please mark it as 'Helpful', to guide other users.
    Wednesday, September 10, 2008 6:01 PM
    Moderator

  • Colin;

    I am using the Robocopy GUI and I am also trying to figure out how to make it run in the background 24/7.  Ken mentioned in a previous post that he thinks (I haven't tested it yet) that if I specify the /MON and MOT/ switch that Robocopy will remain resident in memory and always be monitoring the source folder.

    Are you familiar with how to make Robocopy GUI run in the background.  I would like to have the source folder checked several times a day without having to have multiple duplicate tasks scheduled with Windows Scheduler.

    Thanks!

    Best Regards, Bill Artman Kansas City - USA
    Wednesday, September 10, 2008 6:16 PM
  • Bill,
    I 'think'that you cannot use the GUI portion to run in the background.
    From what I understand, you can use the GUI for a 'one-off' type copy, or use it to build the sequence of commands that RoboCopy needs to work.
    Once you execute RoboCopy using the Monitor switch, it just runs until it is stopped through the Task Manager, or until the server reboots. So, using the Task Scheduler, you can select the Run at StartUp option, which will start RoboCopy and just leave it running.
    However, (there is always an However)! it is possible that you might get an Access is Denied error message. This shows if the job is run as a non-Administrator User, and requires that the Permissions on Cmd.exe are changed.


    Colin

    If anyone answers your query successfully, please mark it as 'Helpful', to guide other users.
    Wednesday, September 10, 2008 6:54 PM
    Moderator


  • Colin;

    Thanks for your clarification.  I really appreciate it!

    Best Regards, Bill Artman Kansas City - USA
    Wednesday, September 10, 2008 6:58 PM
  • One way to make it run in the background is make it a batch file then write a vbs file with the following code:

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run chr(34) & "C:\Documents and Settings\Administrator\My Documents\Voice\Moving Voice Files.bat" & Chr(34), 0
    Set WshShell = Nothing


    change the path to the path of your batch file then
    put that code in a notepad file and save the file as a ".vbs"

    when you run the vbs it will run the batch file in the background.
    Wednesday, February 24, 2010 7:46 PM
  • If your goal is to just to keep two folders in sync, isn't it better to just run something like Live Sync or Live Mesh?
    My two cents :)
    Wednesday, February 24, 2010 9:44 PM
  • Given that they aren't supported on Windows Home Server, umm, probably not. :) (Though Live Sync should install...)

    And neither really shines at copying from this pc, on my local network, to that PC, also on my local network.

    I'm not on the WHS team, I just post a lot. :)
    Wednesday, February 24, 2010 10:30 PM
    Moderator
  • You thought right actually. I`ve been using robocopy(cmd ver) for a few years for different scenarios(backing up, syncing) and it really copies only the files changed. why bother with identical stuff? That`s why it is called ROBUST file copy, not "i`ll-just-copy-it-over-once-again".
    Wednesday, April 28, 2010 8:25 AM
  • /MIR with /MON is a bad idea:
    Say you have /MIR /MON:10. When robocopy detects 10 changes, it will fire off it's copy again (/MIR). /MIR effectively purges everything in the destination (/PURGE), then copies everything over again, including empty directories (/E). So every time 10 files change, you're copying the whole thing all over again. With a lot of data, this can take a long time.
    Personally, I don't back up work in process in any way. It's annoying to lose it, but it's a couple of days of annoying, not multiple months. Originals and final product are both stored on multiple media, including my server. Originals go straight to the server; I have Bridge save a copy there (even though it's slow as molasses). Finals go to the server when I'm done.

    I'm not on the WHS team, I just post a lot. :)

    Just to clarify, this is NOT how /PURGE with robocopy works, /PURGE does not clear out and recopy everything.  /PURGE removes any changes in the destination that do not match the source (EXTRA files).  If you change 10 things in the source, and 0 in the destination, the only action that occurs is copying those 10 changes, it does not copy or do anything else.    If you delete things in the source, the destination will delete those changes, that's what /PURGE is for, otherwise those deleted files will remain in the destination.

    Think of /PURGE as "Also delete files that no longer exist in Source, instead of just copying new/changed files".

    Derek

    Thursday, October 20, 2011 5:37 PM