Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

327
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!