Synchronize Files and Folders using Powershell
Hello everyone!
Last week I was helping an Application Admin to Synchronize files and folders between Source and Destination Servers. The challenge was because some folders had really long hierarchies, so you could imagine something like this.
I would say that doing this for some files it is really ok, but for my case we are talking about of 10GB of data and around 4K folders in the root level. Basically, this was the solution that I was able to come up.
The script in in the Github link below.
Code: https://github.com/marcosfreccia/Powershell-Scripts/blob/master/SyncFileSystem.ps1
For testing purposes, when I ran a small test, that’s something that you could see it.
Off course, there are ways to improve the efficiency and the performance of the code, but I just wanted do something simple and where everyone can read it and understand. If you want to improve it, at least you have a starting point.
I hope it helps!
Marcos Freccia
Data Platform MVP
Posted on January 17, 2018, in Comunidade, Dicas, Powershell, Scripts, VirtualPass and tagged Compare Files and folders powershell, Compare-Object, Copy-Item, Moving items with powershell, powershell, Sync Files and Folders PowerShell, Sync Files and Folders using Powershell, Sync Files Powershell, Synchronize Files and Folders using Powershell. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0