How-to: Using SyncToy to make a nightly mirror of My Documents

20 Sep 2006
September 20, 2006

I promised a client recently that I’d help set her up to mirror her “My Documents” folder to an external USB drive with nightly updates. I then realized it might be helpful to other folks as well. I promise this is not a highly technical article.

The Goal: Setup a Windows XP machine to make a nightly synchronization to an attached USB drive. Maybe not just XP. Probably works for Windows 2003 and Vista (beta) as well. Clever folks will realize that this could work between any two directories on any two (accessible) drives.

What you Need:

  • A My Documents folder (natch)
  • Another drive to synchronize with.
    • Why another drive? Well the idea here is to be sheltered in the event that the drive containing “My Documents” craters. While I’m primarily aiming this at a USB drive, it could also be a USB key or a second internal hard drive. Or a network share if you’re so inclined.
  • Microsoft’s SyncToy. [download] No worries, it is free. Most reasonably modern computers will meet the system requirements.
    • Potential wrinkle: It needs the .Net Framework 1.1. Odds are, you have it. If not, go get it (the SyncToy installer will alert you if you need it)
  • 5 minutes

Setup:

Using “My Computer”, open the USB Drive and create a new directory named something clever like “My Documents Backup”. This will be our destination folder (or, in SyncToy parlance, the right folder).

Download and install SyncToy.

After the install, you’ll find it under your Start Menu -> All Programs. Go ahead and start it up.

Click on “Create a New Folder Pair.”

For the “Left Folder”, browse to your “My Documents” folder. Really, not much browsing necessary, it should be at the top of the list as pictured below.

Choosing Source

After you’ve selected it, click “Next ->”

For the “Right Folder”, browse to the new folder you created in the first step.

Choosing destination

Again, after selected click “Next ->”

Now we’re prompted to choose what we want to do with these two folders. If making a simple mirror for backup purposes, choose “Echo”. If you envision connecting the USB drive to another computer and working with any of the files, choose “Synchronize”. For purposes of this article, we’re going with “Echo.”

Click “Next ->”

Give this Folder Pair a name. I used “MyDocs Backup”

Click “Finish”

Holy cow, that’s the majority of the hard stuff done already! In fact, if you want to take a coffee break, go ahead and click “Run” and wander away for a bit while SyncToy does its thing. Just keep in mind that the first time it runs, it has to copy everything! Subsequent runs it’ll just catch the new / deleted stuff and go much much faster.

We have one last piece to do: Schedule it so that it’ll run automatically nightly or weekly. And for that, we peek at SyncToy’s Help Menu, where we find an article on scheduling. Copied here for your convenience since I suspect our friends at Microsoft are better at How-To’s than I might be. I took the liberty of sprinkling some notes throughout though:

To schedule a task using the operating system:

  1. From the Start menu, select All Programs – Accessories – System Tools – Scheduled Tasks.
  2. Select Add scheduled task to start the Scheduled Task Wizard. You will see a list of possible programs to run.
  3. SyncToy may appear as an option in the list. If SyncToy does not appear in the list, click Browse and go find it.
    (Note: Odds are, it’s in your c:\Program Files\Microsoft\SyncToy directory)
  4. The wizard will next prompt you to enter how often you want to run the scheduled SyncToy (for example, daily, weekly, et cetera). Select a frequency.
    (Note: I’d suggest weekly unless you make lots of changes to your documents)
  5. The next page asks when to start the task. Select a start time.
    (Note: I’d suggest middle of the night.)
  6. The next page asks for the user name and password to run the program under. Enter your user name and password.
  7. The final page contains an option to open the properties dialog when the wizard ends. Select this checkbox.
  8. Modify the Run textbox to include (append) the –R command line option. –R all by itself will run all folder pairs that are active for run all. (Note: Sufficient if you only have this one pair, or other similar pairs. In which case, you’re done with this step) If you want to run just a single folder pair, add –R“My Pair” to the end of the command line. Note: there is a space before the hyphen but not one after the R. If the folder pair name contains a space, surround it with quotation marks, as the example above shows. For another example, assume that SyncToy is in the folder named C:\My Folder and that you want to run a folder pair named “My folder pair.” Enter the command line as follows, including the quotation marks: “C:\My Folder\SyncToy.exe” -R”My folder pair.” Note that there are two sets of quotation marks in this case: one is around the path to the SyncToy program file and the other surrounds the folder pair name.

And there you have it.


Tags: , ,
32 replies
  1. mll says:

    Nice tutorial. Thanks ! Didn’t know about the -R switch, it opens a wealth of possibilities.:)

    Reply
  2. Tubzy says:

    Thank you for this it is a marvellous invention by microsoft

    Reply
  3. shigawire says:

    Worthless, ‘echo’ mode does not delete pre-existing files or empty folders on right. Super Flexible File Synchronizer (SFFS) is the best tool I’ve found & supports ‘mirror’ mode which exactly duplicates one folder to another without .Net baggage or hidden files & empty folders. It has many other options and previews what actions will take place much better.

    Super Flexible File Synchronizer
    http://www.superflexible.com/

    Reply
  4. Chris says:

    shigawire – you forgot to mention the cost.

    Reply
  5. Devon says:

    Awesome. Exactly what I was looking for. I am backing up a non-profit everyweek and I didn’t want to have to be there! This saves me time and money.

    Thanks!

    Reply
  6. Chris says:

    Devon – so glad you found it helpful. :-)

    Reply
  7. Name says:

    There’s a file name limit which once you hit, the backup or restore stops since SyncToy isn’t perfectly robust.

    Reply
  8. Chris says:

    What’s the limit? I’d not hit it before? Is the limit on full name, including directory structure?

    I use SyncToy for various home and small client projects. If I want something a bit more robust/flexible, I switch to Robocopy.

    Reply
  9. Jim says:

    I’ve followed all the install and scheduling steps as outlined above, but whenever its the scheduled time, the program only opens. I still have to manually hit run for the scan to be performed. Any help?

    Reply
  10. Chris says:

    Jim, be sure you’ve followed step 8 (adding the -R argument along with the pair name).

    Reply
  11. suicidalsam says:

    I didn’t know you could schedule a backup for any files on your hard drive. thanx for the post.

    I lost some important files from my HD last time when my HD died. Thanx again, great post even a novice can follow the instructions and setup a nightly backup.

    Reply
  12. Andy says:

    I have installed SyncToy and it seems to work, and I scheduled it to run at startup, as the PC concerned is not left to run permanently. However it crashed when a file in a directory it was copying was deleted. To avoid this I would prefer to run it as part of the shutdown process, rather than at startup, but the scheduler does not include this option. Is there a way, without spending $30 on System Scheduler from Splinterware, that I can do this?

    Reply
  13. CCS says:

    I have installed synctoy today, works great. However i have one problem, the BIN files (left and right) stored on my documents, how do i move them to different folder or home drive. I’d appreciate your help.

    Many thanks.

    Reply
  14. Chris Kasten says:

    Hi “CCS”. Glad it works for you.

    Not sure I understand the question though. (what’s a BIN?). Are you asking about how to move the My Documents folder?

    Reply
  15. CCS says:

    Hi Chris,

    Once you create a left a righ pair it creates two BIN files (left and right) on My Documents folder. Can i move the BIN files to a different folder instead of My Documents.
    Many thanks.

    Reply
  16. Chris Kasten says:

    Hey CCS – I’m not positive, but I think that’s an option in the SyncToy 2.0 Beta.

    Reply
  17. CCS says:

    Hey Chris,
    I am using SyncToy 2.0 Beta. No such option what so ever.
    Thanks.

    Reply
  18. Dan says:

    Have installed and tested SyncToy and am very impressed. Many thanks to Chris Kasten for blogging this. I have a quick question if anyone can help me… I have sync’d accross my home network, but does anyone know how to sync remotely over the internet?, i.e. when I’m out on the road or away from hme?
    many thanks
    Dan

    Reply
  19. uBeter says:

    I use my BlackBerry, SyncToy, and a 1GB MicroSD card to keep a secure, synchronised mirror with me at all times.

    http://ubeter.com/content/node/9

    Reply
  20. Aengus says:

    That -R switch was just what I was after. Cheers!

    Reply
  21. scruss says:

    SyncToy has changed a bit – you now have to use the SyncToyCmd.exe to get the schedule to work.

    Reply
  22. Misty says:

    This is just what I needed, thank you very much for putting the info out there. :)

    Reply

Trackbacks & Pingbacks

  1. [...] First, download SyncToy using the link above. Plug your drive in and establish a folder pairing between your two folders, in our example D:SyncFolder and C:UsersMeSyncFolder (for more information, check out this tutorial on folder pairing with SyncToy). [...]

  2. [...] get the Mozy client on more machines as I have some extra unused space. I’ll also go with my SyncToy scheduling to do some cross-machine mirroring as well. I use that to cover music and photo libraries that [...]

  3. Backup Followup…

    Following up on a previous post about losing data and backing your stuff up, I thought I’d tell you how I’m automating my backups now. This is only for Windows users (possibly only XP users, in fact — I don’t……

  4. [...] use SyncToy from Micro$oft – you could use it like this Although I know of a couple of people using Cobian [...]

  5. [...] 500 Gazillion GB drives are everywhere. If you don’t already have one, now’s the time, and if you are worried about setting up the backup procedure or file copy process, Microsoft offers a great free tool called SyncToy.  SyncToy can copy, move and synchronize files, folders and drives. It is very customizable and can even be set up to do daily backups. [...]

  6. [...] of OneCare licenses, so I fell back to my tried and true Scheduled SyncToy solution. It grabs her My Docs folder (which is stunningly huge) and syncs it to my large drive [...]

  7. [...] toyed with doing a Hamachi VPN between us and them and then using something like SyncToy (like this article), but for the need this seems to make more sense – and I don’t have to mess around with [...]

  8. [...] How-to: Using SyncToy to make a nightly mirror of My Documents – I’m always a bit surprised at how many searches for SyncToy lead to this one. I also hope it has helped folks. [...]

  9. [...] Microsoft’s free file synchronization powertoy. I wrote an article on how to make a nightly mirror of My Documents last fall. That article is currently number 2 in the “most viewed posts” list and would [...]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>