Jump to content

Recommended Posts

Posted

Whats the best way to sync folders on 2 different machines?

 

I have a large media share that I would like replicated on another server including deleting files as they are deleted on the primary share.

 

I do it manually at the moment and its a bit of a chore.

Posted (edited)
Robocopy in mirror mode.

Robocopy

 

Thanks I found this script but I don't think it deletes the files just copies as far as I can tell.

 

EDIT: actually it works! cool!

 

@ECHO OFF
SETLOCAL

SET _source=\\FileServ1\e$\users

SET _dest=\\FileServ2\e$\BackupUsers

SET _what=/COPYALL /B /SEC /MIR
:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree

SET _options=/R:0 /W:0 /LOG:MyLogfile.txt /NFL /NDL
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging

ROBOCOPY %_source% %_dest% %_what% %_options%

Edited by zag

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...