Link to home
Start Free TrialLog in
Avatar of elentini
elentini

asked on

How to make Robocopy work

I am trying to automate the process of copying my pictures each day from my laptop to a USB drive.  The USB drive will have several Gb of images on it and the laptop will have a few hunderd Mb.  I keep some images on my laptop to work on for weeks.  What I want to do is copy files from my laptop to my storage drive if they haven't been copied before.

The code below is what I am running.  I copied this from an exchange expert post but it only runs for a sec and no log file seems to be generated.  I don't know where to start, as it seems, according to the manual that something should have happend.
All of my disks are formated NTFS

Any thoughts?
Thanks,

Brad
@ECHO OFF
SETLOCAL
 
SET _source=E:\All Music
 
SET _dest=F:\My Music
 
SET _what=/COPYALL /B /SEC /MIR
:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree
 
SET _options=/R:1 /W:1 /LOG:MyLogfile.txt /NDL
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging
 
ROBOCOPY %_source% %_dest% %_what% %_options%

Open in new window

Avatar of Don
Don
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, the quotes got stripped from my robocopy documentation example. But you get the idea: try quotation marks around _source and _dest
just noticed something on my script
robocopy "E:\Music" "F:|Music" /S /V /TS /FP /LOG+:"My Music.txt" /Z /R:10 /W:30
needs to be
robocopy "E:\Music" "F:\Music" /S /V /TS /FP /LOG+:"My Music.txt" /Z /R:10 /W:30

hth
Carrzkiss