IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

Robocopy Example to Mirror Web Server

Just to solve a challenge of dealing with legacy CMS that’s only specifically mapped to an old server. The contents need to be copied over to a new server periodically throughout the day and it has to act like a mirror (option /mir) in such a way that net new files are copied and any deleted directories and files are also reflected on the new server.

As the server was upgraded, there is a couple files that cannot be overriden. With the use of Windows Robocopy, certain directories such as App_Data and aspnet_client can be excluded (option /xd). In the same way, files like global.asa and web.config (option /xf).

Robocopy command:

robocopy \\shared\d$\itnota\ D:\itnota\ /mir /e /xd "App_Data" "aspnet_client" /xf "global.asa" "web.config" /log:"F:\migration.log"

The command then can be set on a task scheduler to run automatically.

Robocopy commands in Task Scheduler

More Windows Robocopy examples can be found on the links below (Further Reading).

Further Reading

Robocopy
Robocopy and a Few Examples
Robocopy /mir switch doesn’t copy security
MCSA Windows Server 2016 Complete Study Guide: Exam 70-740, Exam 70-741, Exam 70-742 and Composite Upgrade Exam 70-743 2nd Edition

January 29, 2014 Filed Under: How To Tagged With: Task Scheduler, Web Server, Windows Robocopy, Windows Server

Buy me a coffee?

Buy me a coffee If you find any of the articles or demos helpful, please consider supporting my work here, you'll have my big thanks!

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure