How to synchronize two folders on different computers. How to solve the problem of file synchronization

I tried and worked with it for a long time different programs. Required to synchronize data from computers and external hard drives. At first it was done manually, but as the work progressed the task became more complicated, as did the number of synchronized folders and files and synchronization methods. Where did I start and what have I come to:
1). Microsoft SyncToy 2.1.
"+" - free, simple, quite convenient
“-” - it dropped several times and started synchronizing the wrong thing and in the wrong direction (obviously it was due to the fact that the amount and volume of synchronized information increased). Once again, after such a glitch, I read and searched for a long time and eventually opted for home-written programs
2) the simplest version of xStarter - by the way, it allows you to do a lot of things, again from written actions / scripts, etc. assemble it right away exe file, which can also be made into a service if desired. However, having suffered with rewriting, finishing, etc. (I just have a lot of “plans” for synchronizing directions and places of receipt, etc.), I switched to Allway Sync.
By the way, dropbox, etc. They didn’t fit for the reason - I don’t like big brother and I’m paranoid
3) Allway Sync.
"+" - Everything is good, convenient, etc. What I especially liked was the synchronization between one source and several “receiving” locations. Works like a clock, BUT
"-" - Doesn't work (at least when I worked with it) by threads, or rather one thread at a time, that is, there are, for example, several tasks: synchronize several different, unrelated folders with hard drive on the computer on external hard, and in the end it runs it all in parallel, as a result, if everything had been in one thread, it would have ended much faster, it also led to catastrophic results, because of which we later had to abandon it, this will be written about later ; It glitched a couple of times, but it was not critical, it will become critical when the volume is large. And in the end, when I got to the point where there were about 150,000 files in one of the folders and the volume of the folder was not small, Allway Sync simply could not stand it when I launched it in automatic mode when connecting a hard drive, synchronization. I had to run the tasks manually and one by one. I really didn’t like it, but I endured it for exactly that moment until it stopped synchronizing just one folder. As a result, I switched to GoodSync.
4) GoodSync. It took me a long time to get used to it, which after Allway Sync (which was understandable on an intuitive level) seemed terribly inconvenient, not informative, etc. Getting used to it took a long time, and not always successfully. I didn’t like that there was only one source and one destination. Allway Sync had multi-directional “multi-ended” tasks, and immediately had to split / duplicate tasks. One of the immediately noticed advantages was that now all tasks were completed in turn. For a long time I could not find (if not through the wizard to do tasks) a connection to a specific external hard drive. For some settings there is no normal description, and it is not always clear what they do. Some things still bother me, but precisely because it looks like I haven’t set it up myself yet, but I don’t want to waste time on tests, and they are absolutely not critical. It’s also a convenient thing for copying a large amount of data when synchronization was not needed or was not used, but you need to copy quickly and the data is almost the same. Over time, I got used to it and began to like it, it doesn’t make mistakes, it processes a number of files without problems and hasn’t made a mistake yet (for a couple of years), there is the possibility of “quick” analysis, md5 verification, copying attributes, etc. In general, my choice is GoodSync

Thanks, I'll try. Today I tried GoodSync - it seems to be a similar program.
But the strange thing is that it does not synchronize all the files from several thousand images; two dozen are not synchronized. GoodSync on the server does not see them on the client’s machine, although they are there.

Click to expand...

1) Question - maybe the filter is working? He is in general settings programs (common for all) and each task also has its own.
2) Also, when comparing, if there is an antivirus, it also blocks files if it considers that they have a virus or are suspicious
3) Set the "Copy blocked files" setting
I have never had any problems with synchronization using GoodSync. But I had to figure out the settings. By the way, there is a fairly sane manual with a FAQ for this program. And why did you notice that he didn’t synchronize some of the data? And try turning on md5. It will take noticeably longer, but you will check it and plus this method is more reliable. At least I think I've seen something like this - when you open a photo, but it opens only halfway, because... "rotten". At least you will be protected from this during synchronization. And then we had a case - the database archive was backed up, but in the end the file turned out to be broken (because it was simply copied, or rather recorded incorrectly)

Although, of course, there was a fly in the ointment. The program is paid, costs 600 rubles. The free version, after 30 days of use, allows synchronization of only 100 files and 3 tasks.

In general, of course, in the case of good software, 600 rubles is not a pity. On the other hand, I still tried to find something similar for nothing. 🙂

And I found it. - free software to synchronize files and directories.

Uses innovative algorithms to synchronize your data between personal computers, laptops, USB flash drives, etc. Allway Sync combines ironclad reliability and an extremely simple user interface.

Here the interface is not so pleasant, and the site itself is translated into Russian rather poorly. Also, the program cannot synchronize data via FTP, WebDAV or SFTP. But required function It has synchronization with a USB flash drive. It does this no worse than GoodSync and is completely free.

I didn't find instructions on the site. Therefore, I’ll tell you where and what needs to be configured for it to work. automatic synchronization and there would be no need to remember about the program.

1. After starting the program, a new task will be created. Accordingly, you need to select folders for synchronization. In my case it's "C:\Workfiles" on the left side and "Z:" on the right. I’ll tell you why exactly “Z” later.

2. You can perform a manual analysis and first synchronization by clicking the appropriate buttons to make sure that everything is working correctly.

  • When connecting a removable device
  • After a certain period of time

Accordingly, synchronization will occur the moment you insert the USB flash drive into the computer, and Allway Sync will constantly monitor file changes every time a specified time has passed since the last check. If the files are different, synchronization will begin.

There are several more synchronization time options; choose those that are convenient for you personally. In fact, the “When connecting a removable device” option alone will be quite enough.

Click "OK" to save the settings.

4. To ensure that the program loads every time you turn on the computer, select “View -> Settings... -> Application” in the top menu and check the box “Launch the application in the taskbar when you turn on the computer.”

Now the setup is complete. And then they brought me some document on another flash drive. So, what do we have here? Oops! All my top-secret work files were synced with someone else's flash drive!

To prevent this from happening, you need to change the drive letter of your working flash drive. For me it's "Z", although the "X" disc also sounds good. 🙂

To change the drive letter, insert your flash drive into the computer, with which you will synchronize. Then open "Start -> Control Panel -> Administrative Tools -> Computer Management -> Disk Management". Find the flash drive there, click right click, select "Change drive letter or drive path" and select any letter, but preferably closer to the end of the list.

Now Windows will assign this letter to your flash drive every time and synchronization will occur only with the desired device, and not with anyone.

After this, through the Allway Sync menu “File -> Export” you can save the program and task settings in order to import them on other computers with which synchronization is required.

Now I don't worry about important files. They are duplicated 3 times: on a flash drive, on home computer and on a work laptop. In addition, the data is synchronized and I always have an up-to-date copy. So I’m not afraid of the loss of a flash drive, the death of a hard drive, or system failures! 🙂

About two years ago I created a project - a small client program that can be installed on any device and simply synchronizes files.
For example, you could specify that documents would be synchronized between your home and work computers. Music and books between the home computer and phone. Backup between home computer, work computer and server. This program could also control the subsequent distribution of any file on the system. That is, you, as the owner, could always find out the history of the file: copying to a flash drive, to another computer, by email, etc.

Then I almost already received funding, but the investment fund with which I worked at the last moment demanded a serious share in the business. And I decided that the game wasn’t worth the candle. And then somehow there was no time for that.

Yes, you say, there is cloud storage and why is it needed when there is Yandex.Disk, Dropbox and a bunch of cloud services file storage. Well, it’s just not always acceptable and convenient. Cons:
1. You trust your files to a third party without any guarantees. (I’m not paranoid, but you wouldn’t leave your intimate data in such a storage facility)
2. To access them you need the Internet. And this in Russia is still not always possible with the required speed.

A holy place is never empty and the BitTorrent company released something similar, but in a stripped down form. Their program simply synchronizes files between different platforms and systems as soon as they go online or are within the same subnet. Unfortunately, you cannot flexibly configure synchronization rules, but there is an excellent client that is administered through either a native interface (WIndows, MAC OS X, Android, iOS) or a web interface (*NIX).

I no longer go to my mobile phone for photos, documents and music, and I don’t go to the server to get a rarely updated backup.
There are several folders on your home computer:
Telephone
Server
General
Auto

To put something on my phone, I just copy required file to the "Phone" folder. It will appear on my phone in a few seconds
To exchange documents with the guys at work, I put them in the general folder. And after a few seconds, this file will appear for all the people I need - locally and not in the cloud.

In the car, there is a Google Nexus as a media center, looking at the Internet via 3G. On my home computer I put navigation maps and music into the Auto folder. Everything is automatically folded into the car. I take it from the Auto/recorder folder interesting points captured by a video recorder (the device in the car is always online).
Saves a lot of time.

We wish BotTorrent success in the development of their wonderful project.
Download.
Available on Google Play Market and Apple AppStor. I think it will appear soon mobile version Windows.

PS
Thanks to Murin Sasha for the tip)

I think each of us has asked the question “What is this Briefcase that appears in the Create menu and what is its purpose?” I also became interested in what a briefcase is for in Windows. At first glance, it may seem that Briefcase performs the same functions as a folder, but has a different icon, but this is far from true. The fact is that you cannot create files and folders directly in the Portfolio, but only copy them to the Briefcase and change them. You can create only in subcategories, i.e. in subfolders! And all this is due to the fact that the portfolio functionality is designed to perform synchronization between files and folders.

In this article, let's find out why we need a briefcase in Windows and look at how it works.

According to the help, Microsoft recommends using Briefcase in two situations, when syncing files and folders from a PC over a network and between a computer and a removable device. I would not use the portfolio for synchronization over the network, since it is much easier to give access to resources to a specific user and he will be able to work with documents over the network. But we will look at synchronization through a removable device!

As a rule, the need for synchronization arises if you work with the same documents on different computers. Therefore, you always need to have latest version files. Of course, you can copy and delete the entire folder in which your documents are located each time, so as not to have to figure out which files were changed. But, if there are a lot of files, then this can take a lot of time. In this situation, the Windows portfolio can help us out.

Let's create a portfolio at the root USB flash drives(RMB\Create\Portfolio\Working documents)

And we will copy into this Portfolio the files and folders that we are going to work with in the future on another computer. It is at the moment of copying documents and folders that a connection is created between them, thanks to which file versions will be compared.

As I said earlier, we cannot create anything in the Portfolio, since there is simply no “Create” item in its menu.

But, we can create files and folders inside folders

All this is due to the fact that between the files and folders inside the Portfolio there is a connection with the files and folders from which they were copied. If we try to create a file, it simply will not have a connection, which means there will be no one to synchronize it with.

After we have worked with documents on another computer (or simply with documents in our Windows Portfolio), we can perform synchronization (copy changed files and folders).

To do this we can either right-click on the Portfolio and select "Update All"

Or go to the portfolio and click “Update all objects” on the toolbar

As you can see from the screenshot, since the last synchronization I have made changes to the Partnership file and created a file UUUUIIIIII in a subfolder. So, during the update process, the “Partnership” file will be replaced, the file UUUUIIIIII will be created and thus there will be identical files on both sides.

To get more detailed information, you can right-click \ Details and if any non-standard situations arise (both files have been updated since the connection with the portfolio was created) make the right decision.

Also, by going to (File (folder) properties \ Status) you can see information about which file (folder) it is associated with.

You can also update a separate file, separate it from the original and find the original to which the file or folder is attached.

Thank you very much for sharing this material! :-) Our Training Center will not forget you!

The directory is read using the get-childitem command. To take into account subfolders, the -recurse option is added to it, and to distinguish files from folders, the PSIsContainer() function is used. If it returns True, then the element is a folder, otherwise it is a regular file:

$source = ¨c:files¨

$srcfolder = get-childitem $source -recurse | where-object($_.psiscontainer)

$srcfiles = get-childitem $source -recurse | where-object(!$_.pciscontainer)

To solve our simple problem, we need four lists: the first two contain source files and folders, and the remaining two are the resulting files and folders. The synchronization process comes down to iterating through these lists and copying files from one folder to another.

The first loop checks whether the source directories exist in the backup folder, and if they do not already exist, they are created using the new-item command.

foreach ($folder in $srcfolders)

$srcpath = $source -replace ¨\¨,¨\¨ -replace ¨:¨,¨:¨

$dstpath = $folder.fullname -replace $srcpath,$destination

if ($dstpath -ne ¨¨) (

if (! (test-path $dstpath))

¨Creating the ‘$dstpath’ folder.¨

new-item $dstpath -type directory | out-null

A very similar cycle is performed when comparing the resulting and source list of folders, thereby creating the exact structure of subfolders. Two other cycles process files: the first copies updated objects from the source to the resulting folder, the second - those not in the source directory - from the final one. You can find out whether a file has been updated by its hash code. Note that since files are opened in read-only mode, they are not blocked from being used by other programs. However, according to the rules of good form, the file must be closed with the Close() function after the hash code has been calculated:

$md5 = new-object system.security.cryptography.md5cryptoserviceprovider

$fs = new-object system.io.filestream ($file,$mode,$access)

$hash = $md5.computehash ($fs) # file hash code

$fs.close()

Rub over new file its old copy is meaningless, so let's add commands to compare modification dates. When moving files back that are missing from the original folder, no checks are required; simply execute the copy-item instruction. The entire script is given in the listing - it is given the paths to the source and destination folders (don't forget to add closing slashes, for example c:filessource), and then it does all the work on its own and only displays information on the screen about what exactly is happening. Note that even if you have not previously created the final folder, the script will create it independently:

if (! (test-path $destination))

new-item $destination -type directory -force | out-null

So, this script will help copy photos, tables, text documents etc., without wasting time on manual file-by-file comparison. To use it, you can create a simple BAT file on the Desktop, specifying a command like powershell.backup.ps1 c:filesrc d:backup (the path to the script usually needs to be provided in its entirety). In the future, it is easy to sync folders by clicking on this batch file. Let us remind you that the Set-ExecutionPolicy RemoteSigned command, executed on behalf of the “Administrator,” allows the execution of unsigned scripts.

Storing copies of important files in a completely unprotected form is perhaps not entirely correct from a security point of view. Windows system 7, despite Microsoft's best efforts, remains vulnerable to viruses, worms and other malware. To documents that are constantly lying, in fact, in open access, they get there without any problems. Fortunately, in operating system A very useful tool has appeared - virtual disks that are mounted and disconnected on the fly. They are also suitable for backing up any important files that can be accessed by a limited number of users.

A virtual disk is presented in the system as a VHD (Virtual HardDisk) file, which has a complete structure and content similar to that of a hard disk. It is created using the computer management utility built into Windows 7, which is launched through the compmgmt.msc module. In the window of this program, you need to click on the “Disk Management” line and select the “Action Create virtual disk” command from the menu. For new virtual disk the size is set and then the volume is formatted. At the last stage, you can assign a drive letter or link the VHD file to an NTFS folder.

The last method is interesting because copying is allowed to a specific folder, regardless of where the virtual volume is located. By mounting a virtual volume in a computer management utility, you can be sure that neither viruses nor curious users will get to the most recent copy of important documents. The virtual volume itself, i.e. the file with the VHD extension, can be copied to backup media. An additional security measure is virtual volume encryption, available with using BitLocker users of the maximum and business versions of Windows 7. When connecting such a protected volume (and it can be used on other PCs, even where BitLocker is not installed), Windows will ask you to provide a login and password.

Share