Robocopy Bat files

I’m trying to create a bat file to copy over folders and file with Robocopy in Windows XP but not sure how the command would go.
I have a external drive with the drive letter G:
I want to copy these DIRs when running a bat file
C:\MYMAIL
C:\Documents and Settings\user\My Documents
to the external drive in folders I created in this path
G:\Backup\Week-Backup\Week1

This is what I came up with but it’s not working

RoboCopy /Mir C:\MYMAIL G:\Backup\Week-Backup\Week1 /E /COPYALL
RoboCopy /Mir C:\Documents and Settings\user\My Documents  G:\Backup\Week-Backup\Week1 /E /COPYALL

Thanks


ahmad1467Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wmeerzaCommented:
correct syntax is robocopy source destination *.* /mir /copyall /e

This would mirror your data to the external. Just substitute your file paths in the source and destination.
0
ahmad1467Author Commented:
this is what I tryed but it didn't work
robocopy C:\MYMAIL G:\Backup\Week-Backup\Week2 *.* /mir /copyall /e

this is what showed when it ran


C:\Documents and Settings\ahmad\Desktop>robocopy C:\MYMAIL G:\Backup\Week-Backu
\Week2 *.* /mir /copyall /e

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010
-------------------------------------------------------------------------------

  Started : Wed Mar 31 22:52:24 2010

   Source : C:\MYMAIL\
     Dest : G:\Backup\Week-Backup\Week2\

    Files : *.*

  Options : *.* /S /E /COPYALL /PURGE /MIR /R:1000000 /W:30

------------------------------------------------------------------------------

                           0    C:\MYMAIL\

------------------------------------------------------------------------------

                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :         1         0         1         0         0         0
    Files :         0         0         0         0         0         0
    Bytes :         0         0         0         0         0         0
    Times :   0:00:00   0:00:00                       0:00:00   0:00:00

    Ended : Wed Mar 31 22:52:24 2010

C:\Documents and Settings\ahmad\Desktop>pause
Press any key to continue . . .
0
farjadarshadCommented:
http://ss64.com/nt/robocopy.html
from here you can get all the information
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

wmeerzaCommented:
is there anything in the mymail folder? that command tests fine even without the *.*
If there is no change in the contents you get the message that it skipped (because it is mirroring)
0
rizla7Commented:
robocopy C:\MYMAIL G:\Backup\Week-Backup\Week2 *.* /mir /copyall /dcopy:T /b

although i would use something like this:

robocopy C:\MYMAIL G:\Backup\Week-Backup\Week2 *.* /e /copyall /dcopy:T /m /b

and only run the /mir version every so often to clean out the remote copy. prevents sudden 'mistakes'.

with the /m option for first backup you have to select 'files are ready for archiving' in files properties. you can set it on the top level folder and apply to all children.
0
perfectpcCommented:
0
rizla7Commented:
if using win 2003/2000 you should use ntbackup though to backup the files onto a local drive. then robocopy the backup files over to a remote machine. on win2008, use windows server backup. both can be controlled by commandline.
0
rizla7Commented:
oh i forgot to mention WHY. because robocopy will not shadow copy the volume, so any open files will not be backed up.
0
Dave4125Commented:
From what your log states, there aren't any files located in C:\MYMAIL. Either that, or you may not have access to the file? Try this: ROBOCOPY C:\MYMAIL G:\Backup\Week-Backup\Week1  /MIR /COPYALL /E /ZB

Alternative Solution: Use Microsoft SyncToy - http://www.microsoft.com/downloads/details.aspx?familyid=c26efa36-98e0-4ee9-a7c5-98d0592d8c52&displaylang=en
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.