Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tool to synchronize two directories
Message
From
15/03/2010 12:39:49
 
 
To
15/03/2010 08:31:41
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01454472
Message ID:
01454597
Views:
36
>I use RoboCopy for things like this.
>
>
>You can backup or mirror any single directory or entire tree. I often backup certain designated directories with a batch file like so...
>
>ROBOCOPY C:\ThisFolder E:\MyPC\ThisFolder /MIR /R:5 /W:1 /NP /LOG:C:\Backup_MyPC.Log
>ROBOCOPY C:\ThatFolder E:\MyPC\ThatFolder /MIR /R:5 /W:1 /NP /LOG+:C:\Backup_MyPC.Log
>ROBOCOPY C:\TheOtherFolder E:\MyPC\TheOtherFolder /MIR /R:5 /W:1 /NP /LOG+:C:\Backup_MyPC.Log
>
>
>Or you can also backup an entire PC like so...
>
>ROBOCOPY C:\ E:\MyPC\C_Drive\ /MIR /R:5 /W:1 /NP /XF pagefile.sys /LOG:C:\Backup_MyPC.Log
>
>
>The examples above use the mirroring switch. This copies only the files that have changed. It's also important to understand that if a file is opened, it will not be copied/mirrored. When I backup a PC that has MS SQL Server installed, I also add some lines to the batch file to stop and restart the SQL services, such as...
>
>NET MSSQLSERVER STOP
>NET SQLAGENT STOP
>...
>...
>...
>NET MSSQLSERVER START
>NET SQLAGENT START
>
>That makes sure the SQL databases are also copied.
>
>To explain the switches I often use...
>
>/MIR - mirror the source to the target; copy anything new; delete anything on the target that is not on the source.
>
>/R:5 - retry any file up to 5 times if you hit an error (such as file open, etc)
>
>/W:1 - wait 1 second between retries
>
>/NP - no progress indicator, (such as % copied, etc)
>
>/XF - exclude file (list any files you don't want copied/mirrored)
>
>/LOG: - Filename (if you want a log file written)
>
>Notice also in the first example above, how the + is used in the /LOG: switch to append to the log instead of creating a new log file with each subsequent ROBOCOPY command.
>
>And lastly, if you have spaces in the directory structure that you're specifying, use quotes for the path names like so.
>
>ROBOCOPY "C:\Program Files\My Important Folder" "E:\MyPC\Program Files\My Important Folder" /MIR /R:5 /W:1 /NP /LOG:C:\Backup_MyPC.Log

Thanks, this is exactly what I need. I will try all that this week.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform