Pinaki Mukherjee
Pinaki Mukherjee

Reputation: 1656

Synchronize windows folders

I have set up remote sync in my eclipse to copy jsp and js files at different locations. I am observing that sometimes because of this sync (I need to keep build auto option enabled) eclipse is hanging and I need to kill the process.In windows do we have any option to sync two local folders. I searched but options I am getting through third party software. I am using my office laptop, so don't want to use any third party software and want to check if windows provide any easy option for that.

I miss unix and rsync :(


Currently I am using a bat file to copy these files. I think robocopy is a good option too.

xcopy /s /d /y source folder destination foler

Upvotes: 7

Views: 10741

Answers (1)

Chris Kuperstein
Chris Kuperstein

Reputation: 678

Fortunately, there is a useful little program in Windows called robocopy that ships with Win7 and above.

https://technet.microsoft.com/en-us/library/cc733145.aspx

robocopy <source> <destination> /mir /copyall

This is what you can use to copy a source directory to a target directory including all subdirectories, files, and metadata. It's uni-directional so won't check both ways, but there are time and change based triggers you can set with a windows startup task so you can make the folders auto-sync as you work.

If you read the link, you'll find the /mot: and /mon: flags which will watch the folders for changes/wait a certain amount of time then copy again.

In addition, it is really good at logging output, and is excellent when used as a system startup process.

Upvotes: 14

Related Questions