Synchronize.bat helps you synchronize two directories on local and/or remote machines. It uses rsync to synchronize the first path specified to the second path specified. then it synchronizes the files in the other direction. The command-line path arguments uses the same syntax as rsync.
Synchronize.bat takes advantage of the SetNumberOfArguments.bat (GPL) script that is available on this web site. So to use Synchronize.bat, you'll have to download SetNumberOfArguments.bat, if you don't already have it.
You'll also need to install rsync on your Windows computer, if you don't already have it installed. I personally like the free cwRsync (see "Related Links" below). But this script will probably work with most rsync implementations.
Synchronize.bat is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.
Synchronize.bat "path 1" "path 2"
I've just made a slight improvement to Synchronize.bat. Now you can pass in paths that are surrounded by quotes. In addition, I also made Synchronize.bat more verbose, so that you can see what it is doing. The newer version of Synchronized.bat is attached below.
This new version supports an exclude file. Simply put a "SynchronizeEliminate.txt" file in the same directory as the Synchronize.bat script. You can put file patterns in this exclude file so that files matching these patterns will not be synchronized. Thus, speed up your transfers.
You can then delete them at will those files, if they are no longer needed. Or run an automated delete script (there are several on this site).
The new version of cwRsync seems to constantly change the file permission on the UNIX system, whereas the older version leaves them alone. So whenever you use Synchronize.bat to transfer the files and directories, the permission is reset.
The problem is mainly caused by the "-auvz" argument. After changing the argument to "-ruvz", the permission is no longer reset.
The updated Synchronize.bat is attached below.
I've made two improvements to the Synchronize.bat script:
1) It now sets CYGWIN environment variable to "nodosfilewarning" to eliminate warning messages regarding the use of DOS path.
2) It now checks the error code returned by rsync calls. If any rsync calls returns a non-zero error code, that error code is passed out as %ErrorLevel%. If all rsync calls succeeds, then '0' is returned.
The new version of Synchronize.bat is attached below.
We found that changing "-auvz" to "-ruvz" is insufficient for the purpose of using this "Synchronize.bat" script. The correct set of flags for Windows system is "-rltuvz". The corrected version is attached below.
Introduced some typos when adding in the error code functionality. The version attached below fixes the typos.
Did your message disappear? Read the Forums FAQ.
Spam Control | * indicates required field
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.
Messages, files, and images copyright by respective owners.
Copyright © 1996 - 2017. All Rights Reserved.