8

I have two computers, A and B with two folders A1 and B1 respectively. Since these two computers are on the same network, both the folders are accessible on both the computers, until both computers are powered on.

I have recently had the need of accessing data of B1 on A and A1 on B while B or A are powered off respectively.

Since data on folders, A1 and B1 are of the similar kind in fact updates of each other's files, my need would be satisfied if both the folders are always synced so that the files are readily available on either one of the folders even if one of the other computers is powered off.

I can do this by copying and pasting the updated file on the other folder after every update that I make on the file.

But that's what I wish to avoid as that slows down my workflow. So, how should I do that?

I'm on Windows 10(1607).

Any reply with helping intention is highly solicited.

1
  • 1
    You can mount the computer as a network location using Samba or Windows Workgroups/Homegroups.. you might be able to write a batch file that automatically syncs these directories. You could also use cloud-hosted repositories. Jun 30, 2017 at 14:04

4 Answers 4

14

Another suggestion would be to use robocopy's mirror option. You would write the following batch file and then set the batch to run every minute in task scheduler. It will rerun a sync on the directories every 1 minute.

Robocopy Syntax:

robocopy <source> <destination> [options]

In our case you will want to use the /MIR and the /E switch which will mirror all files and subfolders. It would look like this:

robocopy \\computerA\FolderA \\computerB\FolderB /E /MIR

and save as a .bat file. You can then schedule this to run in task scheduler as often as you'd like the directories to sync.

For more documentation on robocopy: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy

3
  • 1
    above link now re-directs to: docs.microsoft.com/en-us/previous-versions/windows/it-pro/… Jul 29, 2019 at 21:18
  • Running that command will mirror the source to the destination, deleting anything in the destination that wasn't already in the source. OP was asking for synchronization, which this does not provide. If he runs that command on A, he might lose files on B, and vice versa. yesterday
  • I believe if you add the /XX switch, it should eXclude any eXtra files or directories from the automatic purge that the /MIR operation performs. Then you'd just need to run the command twice, each with the source and directory swapped, to perform a naïve sync. Note that this does not take into account any files shared between the two machines with different contents-- it will prioritize whichever files are on the first machine selected as <source> and delete the other, regardless of whichever is newer. yesterday
4

Microsoft SyncToy combined with Task Scheduler will do exactly what you are asking: https://www.microsoft.com/en-us/download/details.aspx?id=15155

4
  • 1
    It's not necessary to install new programs to achieve what OP wants. Try to find something within the operating system before suggesting third-party programs (not sure if that is considered third party or not because it's Microsoft) in the future, please. Jun 30, 2017 at 15:33
  • @Ramhound yes it does. Map the network drive, right click a folder, click Always available offline, and do the same on the other computer Jun 30, 2017 at 19:04
  • SyncToy does not list Windows 10 in System Requirements. It only goes up to Windows 7. Jul 27, 2019 at 22:15
  • SyncToy is getting long in the tooth, but it still works on Windows 10, here is a tutorial on how to install it on Windows 10: windowsreport.com/synctoy-windows-10
    – Ruben Vega
    Aug 14, 2019 at 18:21
2

I have a trusted source in How-To Geek if you like their method.

  1. Map the network drive.
  2. Right click a file or folder.
  3. Select "Always available offline".
  4. Schedule sync jobs by going to Sync Center, clicking "Schedule", and setting a timing.

Refer to the linked guide if you can't get it working with just the instructions I have provided.

1
  • 2
    OP asked about two folders on the same computer.
    – abalter
    Jul 16, 2019 at 14:55
1

Since you do not need FTP, you can use ViceVersa

It's a free tool which allows 1-way or 2-way file sync between any 2 locations that can be accessed via Windows Explorer. That is to say, it cannot be used for FTP, but can be used between any two locations on the same computer, or same network, including bluetooth, external drives, etc.

This software allows checksum comparison, or date, or size. You can set it up to auto synch 2 locations in the background anytime it detects a change. It uses a database to track file/directory changes between locations (which is important for certain use cases).

You can also use WinSCP, which has the added feature of being an FTP client, so if you need to synch with a remote server, you could.
In addition to syncing entire files/directories, it also allows you to synch just the time stamps of files of the same name and size. It may not do this for the directories themselves, however.
Beware, though, that WinSCP will NOT do a byte-byte (checksum) comparison when comparing any files between source and destination directories. You can choose to compare via timestamp and/or file size. This means, for example, that it cannot correctly determine if say a config file or htaccess file is the same or different between your dev server and live server, if they are the same size, but include a different url inside the file.
Annoyingly, when using the "directory compare" option (that highlights differences between the currently displayed local and remote directories):

  • 1) files of the same name are not aligned (ie it will not show a blank line when the corresponding file/directory does NOT exist in that location)
  • 2) while it highlights "missing" files, it will NOT highlight missing directories ! IMHO, that severely limits the usefulness of this tool.

When you do want to see a full (recursive) file and directory sync preview, it may take quite some time, like 10min or more, so that may be a good time to get a beverage refill or check your social media/email :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .