bash - Sync from dir1 and dir2, and keep the two directory same -


i want sync source directory local directory, used use command: rsync -av /path1/dir1 /path2/dir2 , add contents of dir1 dir2.

however, want keep dir1 , dir2 same. not hope else can add files dir2 without using rsync command (means want delete other contents not belongs dir1 when sync dir1 dir2)

thanks!

according the documentation:

    --delete                delete files don’t exist on sender 

so, following should work:

rsync -av --delete /path1/dir1 /path2/dir2 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -