Easiest way to sync two folders?

Associate
Joined
24 Feb 2004
Posts
1,083
Location
Leeds/Cyprus
Need some automated utility that'll automatically synchronise the documents folder on my HDD with a USB drive and an external HDD every time I plug them in, automatically copying the most recent version of each file to the other medium.
 
synctoy will do it, but not automatically. You can programme the backup in though, so it would only be a couple of extra key presses.
 
Right, downloaded Synctoy and read through the white paper, but it doesn't seem to list the command line parameters for it in there. Where can I find them, so I can make an appropriate batch file and schedule it to run at intervals?
 
I use a bat file with xcopy

Create an autorun.inf and copy this in there....

[autorun]
action=Backup
open=backup.bat
label=Backup
includeRuntimeComponents=True

then create backup.bat and copy this in there (modified to suit your setup)

@Echo off
echo -------------------
echo Removable Device Automatic Backup
echo -------------------
echo Back up modified files only...
xcopy "\USB Data Source" "D:\My Documents\USB Data Backup\" /Y /E /R /D
echo Backup Complete!
Pause.

When you plug the drive in you'll get the usual autorun options with a new backup option :D
 
CLI for SyncToy - the quotes are needed.

"C:\directory where SyncToy is installed\SyncToy.exe" -R

This will sync all the directories that have 'Active for run all' option enabled.

It can be set as a scheduled task.

I think there are more CLI switches available.
 
You mean if you have drives USB1 and USB2 and they backup to the same folder?
Not quite - if I have multiple USB external drives, then plug in a usb key will it backup just the usb key?

I'm assuming that because you've used "\USB data source" it will backup the source from which the .bat file is loaded?
 
Not quite - if I have multiple USB external drives, then plug in a usb key will it backup just the usb key?

I'm assuming that because you've used "\USB data source" it will backup the source from which the .bat file is loaded?

Yeah it backs up the device from which the .bat is loaded. So you could have device USB1 backup to the same folder or different folder from device USB2.

Does that answer your question? :confused: :)
 
I still run an xcopy commant in a batch file to copy new documents to my backup partition twice a day, but that only needs to be one-way, I need it to automatically copy new files to and from the external devices, preferably automatically the first time I plug them in.

SyncToy seems to be the only suggestion that'll sync folders both ways. Sone's suggestion to set up the USB drive's autorun.inf to run SyncToy on plugin is probably the best way, but I still haven't found the command line switches for it anywhere - it just opens up a wizard whenever I run it. I'll run it manually if I have to, but would be cool to have it sync anything I plug in automatically! (This is why I'm a sad nerd, I spend more time setting up my computer to do something automatically than it would take me to just do it myself!:))

Would SyncToy still work if the drive letter assignments change? The USB stick doesn't always get the same drive letter depending on what else I have plugged in. Would it also sync documents stored on my smartphone's memory, or is it only ActiveSync that can do that?
 
As LeperousDust suggested use Robocopy. I tried using synctoy to backup my emails to a server backup on logoff but using synctoy in a script didn't work. Robocopy does the job perfectly! :)
 
Exactly, everyone seemed to have missed the fact robocopy is script version of synctoy basically, and its very versatile. But still dependant on drive letters...
 
Exactly, everyone seemed to have missed the fact robocopy is script version of synctoy basically, and its very versatile. But still dependant on drive letters...

If you run robocopy from the usb drive can you avoid having to define a drive letter?
 
Back
Top Bottom