How do I synchronise two folders in real-time in Windows 7?

154

84

I want to synchronise two folders in real time under Windows 7.

Basically, I want to monitor a folder and synchronise each change (new files, changed files, deleted files) to another drive. It has to be in real time, so it gets synchronised instantly when a change happens. A one-direction synchronisation is enough.

I tried Microsoft's SyncToy, but it does only syncing by hand or scheduled (thus not satisfying the "real-time" requirement).

Can this be achieved with Windows 7 itself? If not, are there other methods of doing this?

acme

Posted 2009-11-04T11:14:19.703

Reputation: 621

I just started using allwaysync - works like a charm – Hugo Forte – 2014-09-16T13:32:14.347

1The nice thing about using a pure windows solution is that the windows api has events you can hook into to get an event the moment something changes, which is much less error prone than scanning files/directories like some open source tools do. – Kelly Elton – 2015-03-26T17:06:05.450

Never tried this software but looks promising. http://www.techsoftpl.com/backup/index.php

– Moab – 2015-12-30T21:33:43.553

Instead of syncing folders, you may just need to create a symbolic link using the built-in MKLINK command. It makes files and folders appear to be in two places at once even though it's really only in one place. – ChaimG – 2016-06-10T13:30:05.460

Answers

91

Dsynchronize lets you do this. I'm not sure how it works in Windows 7 but it's freeware and standalone so there's no harm in trying.

CGA

Posted 2009-11-04T11:14:19.703

Reputation: 3 767

1This is a great tool, but when I mapped a Linux samba folder to drive Z: using net use command, the files cannot be synced from Windows local folder to Z:, it reports "Access rights error", has anyone met this before? – Kelvin Hu – 2014-12-04T03:06:52.283

OK, never mind, I changed the folder permission to 777 on Linux, and then Dsynchronize can write files to the net drive successfully. However, a weird thing is that before I change the permission, I can write file to the net drive manually, but Dsynchronize cannot, doesn't it use the account I logged in on Windows? – Kelvin Hu – 2014-12-04T03:22:36.177

4After downloading Dsynchronize.zip from the link in this answer, 360 Internet Security flagged it as having the following risk: "Trojan (HEUR/QVM11.1.Malware.Gen)". The 57 upvotes make me think the trojan is possibly a recent addition (or a false positive), but it's not worth it to me to try. Sorry to have to downvote, but the "no harm in trying" doesn't seem applicable anymore. – kevinmicke – 2015-08-07T23:44:27.217

1

@kevinmicke - I checked out the most recent version and it looks to get flagged by virustotal.com

– jchavannes – 2016-01-02T22:01:03.807

I second jchavannes's finding. WebRoot, too, flagged it as a virus (W32.Malware.Downloader). – ChaimG – 2016-06-10T13:32:24.693

1It worked but make sure you check the checkbox next to each path, otherwise it will not sync anything and a misleading message will be displayed that it synced up successfully because in reality, no files were selected. – zar – 2016-09-29T20:51:31.383

Imgur scan with mcaffe at 2017-03-02 20:44 – Luke – 2017-03-02T13:44:56.727

It probably goes without saying but just in case, I'll mention this. This program has a lot of options. Perform some test runs before you do this one mission critical data. Setting up the options CAN destroy data. – HPWD – 2017-04-28T17:13:04.217

didn't work for me, switched to MS SyncToy, works like a charm – tomka – 2017-07-24T09:29:03.957

1

New link to Dsynchronize: http://dimio.altervista.org/eng/dsynchronize/dsynchronize.html

– szentsas – 2017-10-13T00:31:07.917

@szentsas Your link hosts v2.34.1 while the link posted is for v2.35. This is the v2.35 zip analysis by virustotal. Just marked as 'unsafe' and 'suspicious'. Detection ratio 2/61. It's far more dangerous to follow the instructions that appear in many sites to "remove" Suspicious_GEN.F47V0916.

– cdlvcdlv – 2017-12-09T12:29:58.327

Brilliant recommendation - Dsynchronize is beautiful little app. It does randomly crash now and again, otherwise fab. – Paul G. – 2017-12-23T10:54:56.230

1I'm running this for nearly a year now. It's working quite well, though it's not syncing correctly if a large number of files is changed within a few moments (e.g. when unzipping or checking out a repository). But as I've not found something better, I'll still stick with it. – acme – 2010-09-17T15:16:15.810

4Thanks! I tried it and it works like a charm, runs flawlessly on Windows 7. – acme – 2009-11-04T14:13:10.650

Got to say its straight forward and simple. Doesnt get in the way and does the job. All other sync tools seem to be made for dumb users when I want something to run as a service every day at 8pm. – Chad – 2013-04-09T07:59:57.360

32

I use ROBOCOPY command and made a command line to do the sync between 2 folders (incremental sync) my command is like this

ROBOCOPY "Source_Folder" "Destination_Folder" /E /ZB /XJ /XF "~*.*" "*~.*" "desktop.ini" "Thumbs.db" "*.torrent" ".lock" ".Sync*" /xd "Rubbish" ".Sync*" ".Box Sync" "_private" "Outlook Files" /FFT /MT /R:2 /W:5 /V /MON:1 /TEE

(exclude files: "~*.*" "*~.*" "desktop.ini" "Thumbs.db" "*.torrent" ".lock" ".Sync*") (exclude folders including files in these folders: "Rubbish" ".Sync*" ".Box Sync" "_private" "Outlook Files") Also this repeats itself every minute and/or single change of file/folder.

Regards, Rizwan.

FLAGS

/E      Copy subdirectories, including empty ones.
/ZB     Use restartable mode; if access denied use backup mode.
/XJ     Exclude junction points. (normally included by default).
/FFT    Assume FAT file times (2-second granularity).
/MT     Do multi-threaded copies with 8 threads.
/R:2    Number of retries on failed copies.
/W:5    Wait time between retries.
/V      Produce verbose output, showing skipped files.
/TEE    Output to console window, as well as the log file.
/MON:1  Monitor source; run again when more than 1 change seen.

/XF [files]  Exclude files matching given names/paths/wildcards.
/XD [dirs]   Exclude directories matching given names/paths.

Rizwan.A

Posted 2009-11-04T11:14:19.703

Reputation: 11

1Works, and works nicely except for the whole command window up on my screen thing. I know there's ways to run it in the background or servicify it, and I'll check into those. – music2myear – 2016-10-05T17:17:58.057

For reference /MON:1 monitors source and rerun the copy if there are 1 or more changesand /MOT:1 means monitor source and reruns in 1 minute if there where changes. I guess that /MON:1 is enough. – ecerulm – 2016-10-25T12:57:08.513

You can "servicify" commands with NSSM : https://nssm.cc/

– Benj – 2017-11-06T09:43:57.627

Is this really realtime, if you have to have it once per minute? – Tripp Kinetics – 2018-11-30T22:08:15.293

/MON will not remove files if they are deleted from source. For this, you can add /PURGE to the end, to get equivalent functionality to /MIR, with monitoring. – Shane – 2019-03-19T04:45:08.450

This is not real-time. It does a full compare every 1 minutes even if you just use MON:1. At the end of each sync it says Monitor : Waiting for 1 minutes and 1 changes... – Knyri – 2019-03-27T14:27:37.183

21

There's Synkron which is open source and is cross platform.

Mrchief

Posted 2009-11-04T11:14:19.703

Reputation: 452

How to use wildcards for folders blacklist? – The One – 2019-03-05T16:09:38.463

1But does it sync in real time? – acme – 2012-10-23T10:37:52.747

Doesn't look like it :( – jonathanconway – 2013-05-20T05:04:01.487

3This is what is just needed. I don't need it to be real time but like the depth of options this tool provides, creating a schedule works just fine. This tool does support syncing every 1 minute which is pretty close to being real time! – cracked_all – 2013-12-05T21:36:50.000

18

You could use a NTFS Symbolic Link so that the folders on each drive actually point to the same folder.

Dave Webb

Posted 2009-11-04T11:14:19.703

Reputation: 10 126

5This solution could fit if you're not looking for data physical replication. – vegatripy – 2014-08-13T13:02:51.963

4Doesn't full fill my need to copy files on a ram disk back to an SSD. – Mike de Klerk – 2015-11-05T08:09:12.163

This won't work for deleting. I.e. if you delete the entire symlink folder, the original is untouched. – jiggunjer – 2016-12-23T06:44:14.207

This tool is pretty handy. It adds an option to make a symbolic link to the Explorer context menu. – Danny Beckett – 2018-03-17T03:45:09.213

2You can create a NTFS symbolic link to a Samba path, I have several on my desktop to my Ubuntu file server. – Chris Smith – 2011-11-02T18:53:50.117

That's an interesting approach, but I guess it won't work here, the mapped drive (the sync-target) is Linux. – acme – 2009-11-04T14:12:35.113

15

Since I read your comment ".. the mapped drive (the sync-target) is Linux", then I want to give you a way better approach: You only need ssh-access on the Linux target, it is way faster, and works much better over lower bandwidths and longer latencies.

Use WinSCP's "Keep remote directory up to date" function!

You will need a little tweaking on the transfer options to set up always binary, exclude files (typically svn or git files and similar) etc. Also use the "automatic apply" of transfer options. Also, create a session that has the host, local and remote directories set up. At that point, you only need to open WinSCP, activate the session (which then also automatically applies the transfer options due to e.g. host-matching), and hit the keep-updated button.

Or you could script this using WinSCPs scripting tools!

.. and just btw: If the scenario was Unix-to-Unix, then check out this question.

stolsvik

Posted 2009-11-04T11:14:19.703

Reputation: 910

Thanks! I'll take a look at this, sounds like a good idea. – acme – 2012-06-29T12:31:22.900

-1 Sorry, just got my whole dir deleted because of this lousy sync tool. VERY BAD TOOL. – Poni – 2012-10-03T07:36:06.740

1I think this is over-complicated, for wanting to just keep synched. – Menios – 2013-11-20T11:20:36.720

3@Poni: You can cut yourself with a knife too. It is NOT the tool that is at fault here, dude! :-D – stolsvik – 2013-11-20T21:31:09.853

@meewoK: If you think so, then you have no clue what you are talking about. – stolsvik – 2013-11-20T21:31:40.170

stolsvik It's interesting that your response is to make things personal by insulting me. I do know exactly what you are talking about, but your solution is not aimed at an average windows user. Your describing an eccentric option when there are other apps/options that are also easier for novices. This is also obvious because the max upvotes on your answer are 4 (as apposed to >10 for more simple/mainstream) solutions - so the community has voted. On the other hand however, I like this solution and will try it out myself. I wonder how winscp will deal with synching folders in the GB range. – Menios – 2013-11-20T23:03:12.250

1@meewoK: He asked for real-time synch, and he mentioned that the target was a Linux-box. I found the samba-solution (mounting Linux on windows) to be WAY to slow over slow lines, while SCP-solution is quick. Using WinSCP was the only option I found that satisfied my own needs, and it does that pretty good. I wanted to share this. It is very simple to set up the initial synch: Just point left side to local, and log in and navigate remote on right side, and then hit synch. In addition I just mention a couple of extra features that makes the setup quicker - that might seem to complicate things. – stolsvik – 2013-11-21T13:49:05.890

@stolsvik I guess the question has been changed since then-I hate it when they do that. Windows 7 tag and quote "I want to synchronise two folders in real time under Windows 7". In any case I like the winscp way you propose, but don't know how well it scales with many folders. Question I ask here: http://superuser.com/q/678596/216440

– Menios – 2013-11-21T17:31:58.200

8

Below are some of the tools for synchronizing folders in real time, check each and select one for your requirement.

  1. FreeFileSync
  2. AllwaySync
  3. SyncBack Free
  4. Synkron
  5. File Synchronizer
  6. PureSync
  7. GoodSync

Shankar Prakash G

Posted 2009-11-04T11:14:19.703

Reputation: 111

"Customer agrees that Allway Sync Free has certain limitations and that these limitations may change over time without notice or obligation on the part of Developer. Currently, the limitations may not allow Customer to process more than 40,000 files in any consecutive 30-days." -- Allway Sync License: https://allwaysync.com/license

– Ashley Ross – 2017-12-20T09:07:35.413

7

My I've tried quite a few programs and the only ones that do real-time mirroring of folders are:

Personally, I like Yadis! Backup better. It has more features than Dsynchronize. You can enable versioning, # of versions to keep, which file operations to monitor, and I'm sure a lot more. Plus, it has a better looking GUI that looks more refined.

Patrick

Posted 2009-11-04T11:14:19.703

Reputation: 351

1Yadis! Backup is great: real-time updating is fast, interface is friendly, lots of option, and no trojan. As I commented on the accepted answer, after downloading Dsynchronize.zip from the link in this answer, 360 Internet Security flagged it as having the following risk: "Trojan (HEUR/QVM11.1.Malware.Gen)". – kevinmicke – 2015-08-07T23:56:50.417

4

If you want to sync a folder to USB and you use Dropbox already, use the DropboxPortableAHK.

This way, I have my Dropbox files synced on any computer, as well as my iPhone using the Dropbox app and my USB drive I use at uni with this portable version.

jskye

Posted 2009-11-04T11:14:19.703

Reputation: 161

Dead link. Appears to have moved to http://nionsoftware.com/dbpahk/

– JYelton – 2013-04-02T22:25:13.913

And surrender your privacy completely by having important docs on a a system that has been compromised multuple times. – Menios – 2013-11-20T11:21:41.850

1

Another very strong way to sync folders is to use rsync on command line. You will have to download MingW toolchain or if you install cwRsync, it installs rsync.exe that you can run directly.

All you would need is this command:

rsync -r source_path destination_path

-r flag is to recursive for all sub folders.

On Windows (7) the path should be provided in the following format. For example to specify c:\test it will be /c/test or /cygdrive/c/test

This is the most efficient, fast and powerful way to sync folders with large files even though Dsynchronize in accepted answer also worked for me.

It is not live or real time though. Everytime you need to sync, you will run this command.

zar

Posted 2009-11-04T11:14:19.703

Reputation: 873

1

Maybe this one will help you: Allway Sync. Thare are free* and pro version. Features:

  • Flexible configuration and customization.
  • Supports files of any size.
  • Easy-to-use graphical interface.
  • Supports virtually any file system (FAT, NTFS, SAMBA, Netware, X-Drive, CDFS, UDF and more).
  • Can be installed on a desktop, laptop, USB stick, external HDD or a U3-enabled device.
  • Capable of synchronizing more than 2 folders.
  • Synchronize data between your desktop PCs and laptops over network

I used this program and I liked it.

* - free version has a limit of files processed during every 30 days. See Allway Sync End User License Agreement

Bohdan Kuts

Posted 2009-11-04T11:14:19.703

Reputation: 179

1

"Customer agrees that Allway Sync Free has certain limitations and that these limitations may change over time without notice or obligation on the part of Developer. Currently, the limitations may not allow Customer to process more than 40,000 files in any consecutive 30-days." -- Allway Sync License: https://allwaysync.com/license

– Ashley Ross – 2017-12-20T09:07:18.523

I've been using Resilio Sync and it works great, especially across networks. It syncs fairly quickly too, but not fast enough for web development. I have a virtual box with a shared folder that I need to sync to a local folder which is the root of the website. I'll give Allway Sync a try. It's interface is pretty straight forward at least.

– Chris Geirman – 2018-11-04T20:56:02.607

0

I have found FreeFileSync (open source - but watch for adware on install) the best.

I also really like Backup2 (https://bvckup2.com/) for larger tasks as it runs the fastest of anything I've tested, but it's not free and is meant for 1-way syncs only.

Jon

Posted 2009-11-04T11:14:19.703

Reputation: 235

0

You can try SyncBack4all, it's real time folder and files sync program.

kaiser

Posted 2009-11-04T11:14:19.703

Reputation: 1

1Except it isn't free. – Paya – 2012-07-20T07:20:13.320

0

Watch 4 Folder v2.3 - a small (802kb), portable (no installation) and powerful monitoring tool to monitor folders and files activities.
It is simple to use and to set, it can monitor 15 types of events and trigger different actions in case an event occurs.

http://leelusoft.blogspot.in/2011/10/watch-4-folder-23.html

-Been using it on a server, firing off multiple exes - conversion to PDF using Acrobat, stamping them, sending as attachment to offices around the country through smtp calls... little software does many things!!

Shiva Tarang

Posted 2009-11-04T11:14:19.703

Reputation: 1

0

I wanted the same. And in principle the Sync Center within Windows7 would provide that but in another fashion: you only have to set a network folder as Always Available Offline. With this you basically have that a local and remote version synchronized, you are working as if you were on the network but actually it manages to have it locally. In other words you only see one copy but having it in two places, but that is the goal of synchronizing. Instead of being transparent that there is a remotely synchronized copy, there is a locally synchronized copy. In any case this covers the basic goal of network failures.

I must say this is the theory because I got stuck since my network drives are managed by Novel and therefore I don't have the option of "Always Available Offline".

Luis Fernando Robledano-Esteba

Posted 2009-11-04T11:14:19.703

Reputation: 1

0

I use free syncless https://code.google.com/p/big5sync/

it hooks to system and if in seamless mode, sync files in real time. Can't run as service, personally don't like GUI but it works :)

MirrorFolder http://www.techsoftpl.com/backup/ can also do real time sync and it works as service (do not need GUI to load to work) but it's not free ($39)

manuel

Posted 2009-11-04T11:14:19.703

Reputation: 161

-3

You can assign a folder path to a drive with subst.

Code:

SUBST L: "C:\Some\Path"

leaveswater02

Posted 2009-11-04T11:14:19.703

Reputation: 154

2What? How does this result in anything getting synced? – I say Reinstate Monica – 2017-03-06T15:47:20.553