File Sync Help

born2achieve

New member
Local time
6:51 AM
Messages
36
Hello Friends,

i need to sync a files b/w two folders in network path bidirectionally. for example, if new file /modified file on server A automatically transferred to ServerB and vise versa. i tried to look the solution online and robo copy an be used for this. i tried. but i am not getting what i am looking for. here is my try.

Code:
robocopy \\server1\Images1 \\server2\Images1 /MIR /FFT /Z /XA:H /W:5


can you please help in by giving batch script to achieve this. Thanks in advance.
 

My Computer

Computer type
PC/Desktop
OS
windows7 64 bit
My own pitch... non-free "Beyond Compare" ($60), which is a 3rd-party compare product par excellence!! Been using it forever. Can't live without it.

I use its GUI manually, because there are very few situations where I absolutely want to blindly do a "100% sync between folders/files on two locations". But it does have "scripting" capability for batch invocation if you really want to do that, as you apparently want to.

Download its trial version (free, fully functional) and do a "search" (in HELP) for "script", to see what it is and how to use it for automating its functionality.

Myself, I can't live without Beyond Compare.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home-built, two systems (1) and (2)
OS
Windows 7 Pro x64 (1), Win7 Pro X64 (2)
CPU
i5-3350p 3.1Ghz/6MB-cache (1); E8400 3.0Ghz/6MB-cache (2)
Motherboard
ASUS P8Z77-V Pro (1); ASUS P5Q3 (2)
Memory
8GB PC3-12800 DDR3 (1); 4GB PC3-10600 DDR3 (2)
Graphics Card(s)
ATI HD7750 (1), (see TV cards); ATI R7 250 (2)
Sound Card
Realtek ALC892 HD Audio (1); Realtek ALC1200 HD Audio (2)
Monitor(s) Displays
Eizo HD2441W LCD, Eizo S2433W (1); Eizo 24" S2433W (2)
Screen Resolution
1920x1200, 1920x1200 (1); 1920x1200 (2)
Hard Drives
(1) 1TB SATA-II (7200RPM), 2x2TB SATA-III (7200RPM), 250GB SATA-III (10000RPM) for OS; 2x2TB external USB 3.0

(2) 320GB SATA-II (7200RPM), 750GB SATA-II (7200RPM), 150GB SATA-II (10000RPM) for OS; 2TB external USB 3.0
PSU
Nesteq ECS-6001 600W (1); Nesteq ECS-5001 500W (2)
Case
Acousti-Case 360 (1) and (2)
Cooling
Noctua NH-U12P SE2 for CPU, 2x120mm case fans (1) and (2)
Keyboard
IBM PS/2 (1) and (2)
Mouse
Logitech MX Revolution wireless (1); Microsoft wired (2)
Internet Speed
100mbps down / 10mbps up
Antivirus
Microsoft Security Essentials; Malwarebyte Anti-Malware Pro
Browser
Firefox
Other Info
Ceton InfiniTV 4-tuner cablecard-enabled TV card as well as Hauppauge HVR-2250 OTA/ATSC 2-tuner TV card in (1), running under Win7 WMC
Hi dsperber ,

Thank you for the response and this is realtime and i wanted to do automatically rather than manually.

Can anyone please help me in this
 

My Computer

Computer type
PC/Desktop
OS
windows7 64 bit
Hi dsperber ,

Thank you for the response and this is realtime and i wanted to do automatically rather than manually.
That's exactly what I said... "scripting", i.e. automatic functions through batch commands. You can then launch those scripts either manually on-demand, or you can use Windows task scheduler to have them automatically run according to your own preference.

Whatever you can do through the interactive GUI, you can code through batch commands and run them that way instead.

For example... from the HELP, an example of the "mirror left to right" synchronize. This is how you use the folder shown in the left pane (in the GUI) as the "master", and the folder shown in the right pane as the "slave". The "mirror" function copies everything new or different from the left to the right, and deletes any "orphans" on the right (which have no counterparts on the left):

Syncing two folders

Here is a more advanced script which syncs two specific folders using advanced filters. This works the same as loading the folders in a Folder Compare session and performing a "Mirror Left to Right" folder synchronization.

# Turn logging on.
log normal "C:\My Log.txt"

# Load the default session and exclude all but certain file types.
load <default>
filter "*.html;*.htm;*.png;*.jpg"

# Load the base folders.
load "C:\My Folder" ftp://[email protected]/folder

# Copy different files left to right, delete orphans on right.
sync mirror:left->right
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home-built, two systems (1) and (2)
OS
Windows 7 Pro x64 (1), Win7 Pro X64 (2)
CPU
i5-3350p 3.1Ghz/6MB-cache (1); E8400 3.0Ghz/6MB-cache (2)
Motherboard
ASUS P8Z77-V Pro (1); ASUS P5Q3 (2)
Memory
8GB PC3-12800 DDR3 (1); 4GB PC3-10600 DDR3 (2)
Graphics Card(s)
ATI HD7750 (1), (see TV cards); ATI R7 250 (2)
Sound Card
Realtek ALC892 HD Audio (1); Realtek ALC1200 HD Audio (2)
Monitor(s) Displays
Eizo HD2441W LCD, Eizo S2433W (1); Eizo 24" S2433W (2)
Screen Resolution
1920x1200, 1920x1200 (1); 1920x1200 (2)
Hard Drives
(1) 1TB SATA-II (7200RPM), 2x2TB SATA-III (7200RPM), 250GB SATA-III (10000RPM) for OS; 2x2TB external USB 3.0

(2) 320GB SATA-II (7200RPM), 750GB SATA-II (7200RPM), 150GB SATA-II (10000RPM) for OS; 2TB external USB 3.0
PSU
Nesteq ECS-6001 600W (1); Nesteq ECS-5001 500W (2)
Case
Acousti-Case 360 (1) and (2)
Cooling
Noctua NH-U12P SE2 for CPU, 2x120mm case fans (1) and (2)
Keyboard
IBM PS/2 (1) and (2)
Mouse
Logitech MX Revolution wireless (1); Microsoft wired (2)
Internet Speed
100mbps down / 10mbps up
Antivirus
Microsoft Security Essentials; Malwarebyte Anti-Malware Pro
Browser
Firefox
Other Info
Ceton InfiniTV 4-tuner cablecard-enabled TV card as well as Hauppauge HVR-2250 OTA/ATSC 2-tuner TV card in (1), running under Win7 WMC
Thanks for the reply and to solve this issue without GUI, i run the batch script on both the server.

Server A:

If new file or any file changed, take the file and look in server B. if not found add it else replace it.

Server B

If new file or any file changed, take the file and look in server A. if not found add it else replace it.

Will this logic work? if yes then could you please share me the script for one server.
 

My Computer

Computer type
PC/Desktop
OS
windows7 64 bit
Server A:

If new file or any file changed, take the file and look in server B. if not found add it else replace it.
For the sake of discussion, consider a folder on Server A being "on the left" and the corresponding folder on Server B being "on the right".

The operation you are describing would then be considered "COPY TO RIGHT" (as opposed to "mirror to right") for all the "differences" discovered when comparing the files of the two folders being compared on the two servers.

In contrast, the "mirror to right" function would then delete any "orphan" files found on Server B which were non-existent on Server A. The "copy to right" function does not perform this extra step.


Server B

If new file or any file changed, take the file and look in server A. if not found add it else replace it.
This is the exact opposite of the first operation. So this one is considered "COPY TO LEFT".


Will this logic work? if yes then could you please share me the script for one server.
I suggest you download the software yourself (again, free trial, fully functional) and familiarize yourself with its interface and capabilities. You should probably start off playing around using the GUI, comparing two folders (which you navigate to on the left side and the right side), and pushing the "same", "differences", or "all" buttons, so that you understand what the program can do.

When you right-click on one or more selected files on left or right or both sides, the context menu then offers you lots of functions that are then appropriate for you to choose from. When you select that function at the operation is performed and you see the result, you will have learned what's actually going on.

Then look into HELP for "script" and you will now understand how to code the batch commands. Try out a simple case, and you will have learned some more.

I don't know exactly what you mean by "Server A" or "Server B" insofar as does that mean a low-level folder by itself, or does it mean a "parent folder" including all sub-folders, etc. I don't know exactly what files inside this folder structure you want to compare. Only you really understand what you're asking. So my suggestion is simply to try it out, and learn for yourself through trial and error and HELP.

Note that you have all kinds of "session settings" options as well, to define exactly how the comparison should be performed. For example you can have the program ignore date/time differences in files due to Daylight Savings Time vs. Standard Time.

Also, each "compare job" is automatically remembered and appears in a "session list" when you open the program... for you to choose from. So once you do a compare one time you don't have to re-create it from scratch the next time you want to perform the same comparison. Just pick it from the list and "open" it to populate the left and right panes. You can then edit it if you want, before actually performing it.

Honestly, I think you will like the GUI very much.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home-built, two systems (1) and (2)
OS
Windows 7 Pro x64 (1), Win7 Pro X64 (2)
CPU
i5-3350p 3.1Ghz/6MB-cache (1); E8400 3.0Ghz/6MB-cache (2)
Motherboard
ASUS P8Z77-V Pro (1); ASUS P5Q3 (2)
Memory
8GB PC3-12800 DDR3 (1); 4GB PC3-10600 DDR3 (2)
Graphics Card(s)
ATI HD7750 (1), (see TV cards); ATI R7 250 (2)
Sound Card
Realtek ALC892 HD Audio (1); Realtek ALC1200 HD Audio (2)
Monitor(s) Displays
Eizo HD2441W LCD, Eizo S2433W (1); Eizo 24" S2433W (2)
Screen Resolution
1920x1200, 1920x1200 (1); 1920x1200 (2)
Hard Drives
(1) 1TB SATA-II (7200RPM), 2x2TB SATA-III (7200RPM), 250GB SATA-III (10000RPM) for OS; 2x2TB external USB 3.0

(2) 320GB SATA-II (7200RPM), 750GB SATA-II (7200RPM), 150GB SATA-II (10000RPM) for OS; 2TB external USB 3.0
PSU
Nesteq ECS-6001 600W (1); Nesteq ECS-5001 500W (2)
Case
Acousti-Case 360 (1) and (2)
Cooling
Noctua NH-U12P SE2 for CPU, 2x120mm case fans (1) and (2)
Keyboard
IBM PS/2 (1) and (2)
Mouse
Logitech MX Revolution wireless (1); Microsoft wired (2)
Internet Speed
100mbps down / 10mbps up
Antivirus
Microsoft Security Essentials; Malwarebyte Anti-Malware Pro
Browser
Firefox
Other Info
Ceton InfiniTV 4-tuner cablecard-enabled TV card as well as Hauppauge HVR-2250 OTA/ATSC 2-tuner TV card in (1), running under Win7 WMC
Back
Top