Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

324
Vistas
How to achieve a mirror copy in Linux?

I want to make two directories synchronized. I know there is a robocopy /MIR command in Windows that can achieve this. Ex:

robocopy D:\test1 E:\Backup /MIR

When there is a file updated or deleted, the backup directory can keep synchronization.

I have tried in Linux through the rsync command like this:

rsync -a /usr/test /usr/backup

but when I delete a file under /usr/test and then run this command, the deleted file still exists in /backup/test — the two directories can't keep asynchronization. So, how can I achieve the synchronization of two directories in Linux?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

rsync has a --delete option which does what was asked:

 --delete                delete extraneous files from dest dirs

It has a lot of related options.

Further reading:

  • rsync(1)
  • Commonly Used rsync Arguments
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda