[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dirs mirror

On Mon, Sep 25, 2017 at 09:57:54PM +0200, Pol Hallen wrote:
Hi folks :-)

I'd like create a mirror between 2 dirs: one local dir



this "testB" is a samba mounted share dir (//ip/remote_share /home/user/testB)

any idea?

It depends on how close you want those mirrors to be. If they are absolutely identical:

ln -s ../testB /home/user/testA

will create a symbolic link between the two directories. You can 'cd' into either testA or testB and see identical files, changes happen immediately etc. A symbolic link essentially allows you to give a directory a second name.

If this is for backup purposes and you want to periodically bring testB up-to-date with testA, then rsync is your best choice:

rsync -avP --delete /home/user/testA /home/user/testB

This is a one-way synchronisation. testB becomes identical to testA, and any changes in testB are lost. If you need two-way synchronisation (testA and testB have changed, but need to come to a common state), then look at the "unison" package.

thanks for help!


For more information, please reread.

Attachment: signature.asc
Description: PGP signature

Reply to: