Think this should be easy.
Im trying to make a batch file that runs daily. I am using robocopy to copy the data across
So I havehowever instead of it copying to D:dest i would like to to copy to D:backup(todaysdate)Code:robocopy c:\source D:\dest /MIR /DCOPY:t
sorry to ask a different question but I'm setting Robocopy up now and just want to ask, does the MIR switch mean that the copy will be incremental? I've read that on another site but want to make sure that's correct before i include it
TheCrazyTechnician (23rd October 2012)
If anyones interested (and now that I'm at home) this is what I'm running at home for our backups to NAS.
To explain it a bit:Code:md "\\MYNAS\StevePC\%date:/=-% D Backup" robocopy D:\ "\\MYNAS\StevePC\%date:/=-% D Backup" /LOG:"\\MYNAS\StevePC\%date:/=-% D Backup\Log.txt" /TEE /NDL /M /S /R:0 /W:2 /XJ /B /XF *thumbs.db* *ntuser.dat* /XD "$RECYCLE.BIN" "System Volume Information" "ProgramData" "C:\Windows" "C:\Program Files" "C:\Program Files (x86)" *Temporary* "C:\Users\Steve\Favorites"
Make new folder daily for changes to pc.Code:md "\\MYNAS\StevePC\%date:/=-% D Backup"
Copy D drive to my NAS with todays date in folder.Code:robocopy D:\ "\\MYNAS\StevePC\%date:/=-% D Backup"
Write logs to log file.Code:/LOG:"\\MYNAS\StevePC\%date:/=-% D Backup\Log.txt"
Output to console as well as logCode:/TEE /NDL /M /S /R:0 /W:2 /XJ /B
Don't log folder names, only files
Only copy files with archive bit (then remove archive) aka incremental
Copy sub folders
Ignore junction points
Use backup operator (stops permission issues)
Ignore certain files, and directories.Code:/XF *thumbs.db* *ntuser.dat* /XD "$RECYCLE.BIN" "System Volume Information" "ProgramData" "C:\Windows" "C:\Program Files" "C:\Program Files (x86)" *Temporary* "C:\Users\Steve\Favorites"
So every time it runs it'll create a new folder on my NAS, and only copy files that have changed/new into it, log it and mark it all not to archive again.
zag (23rd November 2012)
Great stuff. I've just setup robocopy to mirror our main file server with a batch file whenever I feel like it.
Works really well so far.
Sorry to bring this back up but does /MIR mean I dont have to use /B
I understand that /B is back up mode ( but what is back up mode?)
So say if I want to copy user directories from the server to a NAS if I have to do a restore from the NAS to the server is it posible for me to run the batch file but just swap the source and dest paths around. Or would i have to play around with permisions?
Or would a COPYALL or SEC be more usefull?
Last edited by MattDLEA; 16th January 2013 at 11:33 AM.
In terms of the copying back, honestly not sure, haven't tried doing it with the same line
MattDLEA (16th January 2013)
I mean if i use
That should copy all the staff profiles and permisions.Code:robocopy c:\Staffprofiles NAS:\backupstaffprofiles /MIR /DCOPY:t /COPYALL /B
In our Staffprofile folder we have joeblog(folder) which i can get in to and then joeblog.V2 which I cant get in to (when logged on the server as admin) not that i want to get in.
What I'm getting at is if all staff profiles break would it be as simple as
Or would there be a different way to disaster recover?Code:robocopy NAS:\backupstaffprofiles c:\Staffprofiles /MIR /DCOPY:t /COPYALL /B
There are currently 1 users browsing this thread. (0 members and 1 guests)