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?
 
farjadarshadConnect With a Mentor Commented:
http://ss64.com/nt/robocopy.html
from here you can get all the information
0
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.