Sync USB pen drive to local folder when plugged in?

Soldato
Joined
6 Jan 2006
Posts
3,423
Location
Newcastle upon Tyne
As title, is it possible? Going to be doing some work on a laptop while staying away on business and then on a desktop when back home.

It will be really important stuff and while I can work on the USB stick copy I want to make sure that its backed up everytime I plug it into the laptop or the desktop.

Thanks for any advice

Mark
 
robocopy is best for this

on both the deskop & the laptop, go into disk management and set the usb drive to always use a certain drive letter (a high one, so nothing else uses it), like U: (for usb pen ;))

put robocopy.exe in c:\windows\system32 on both machines

make a bat file for robocopy..

robocopy /e u:\docs %userprofile%\desktop\docs


that would copy everything & subfolders from u:\docs to desktop\docs.

save the batfile as u:\backup.bat , create u:\autorun.inf and set backup.bat as the file to autorun (copy the autorun.inf file from a cd/dvd program/game to get the format correct)

you can change %userprofile%\Desktop to %userprofile%\Documents or "%userprofile%\My Documents" depending on whether it's vista or xp


best not to use u:\ as the source to copy from (ie, use u:\docs and keep your files in there) otherwise it'd try to copy hidden files from it, etc


that's how everyone should configure their backup drive.
 
And if you want to go a little extra (and you have it enabled) play around with autoplay inf, and you can have it say backup in the popup box that appears when you plug it in (the choose that as the default action) no software or anything needed. Just a bit of text, robocopy and autoplay :)
 
Robocopy.

I used to use batch files for certain sticks and external hard drives, but Robocopy just makes everything so much easier.
 
that's why I said to use disk management to set the letters, the machine remembers the drive letter then, my mrs's pen drive is always P: because it's called 'pinky' :D
 
How do you set up the drive letters?

Ive gone into admin tools, computer management and then disk management but when I put the USB drive in it doesnt show on the list with the HDD's?

Thanks
 
best thing about robocopy, it'll only copy newly created or newly saved files

so on the first run, it'll copy everything, then each run after that, it'll only copy the updated or new files :)

make sure you keep the /e in there or it'll ignore subfolders
 
Where can I download robocopy from? Wiki comes up top on google and not sure about the rest of the results?
 
best thing about robocopy, it'll only copy newly created or newly saved files

so on the first run, it'll copy everything, then each run after that, it'll only copy the updated or new files :)

make sure you keep the /e in there or it'll ignore subfolders

You can do this with xcopy and you don't need to assign a drive letter. Robocopy is an awesome tool (i use to to backup emails to my server) but in this situation its a lot of messing about for something that could be done with xcopy.
 
does it? how do you get xcopy to only copy new or updated files? and ignore files that are unchanged

i'm not being sarcy (the question probably reads that way), just interested :)
 
does it? how do you get xcopy to only copy new or updated files? and ignore files that are unchanged

i'm not being sarcy (the question probably reads that way), just interested :)

Annoyingly i've not got my usb stick with the code on it with me - typical! :rolleyes: Both the stick and the backup created with it are at home :)

Looking at the switches I think its a combination of /d and /u I'll check later
 
with /d you'd be copying some files needlessly then though, because 'changed since date' would still copy files even if they already exist..

and /u would prevent newly created files from being copied


http://www.ss64.com/nt/xcopy.html

again, i'm not being awkward, it's just the way i read it
 
/d makes perfect sense, if you have a file that's existed since time dot but is updated over time (such as a word file) you'd want to copy the new version of that file (with the same file name). Unless you want uniquely named (time stamped) incremental backups......then xcopy isn't suitable ;)

/u might be an error :p
 
Back
Top Bottom