Sync data between directories

Associate
Joined
18 Oct 2002
Posts
2,055
Location
Southend-on-Sea
Is there a way I can have two directories keep in sync with each other? I've just setup my first ever headless Debian server. I've got a 160GB drive for storing the files I want to share over the network but I want to keep this in sync with a folder on my windows laptop.

I've shared a directory on my laptop and set Debian up so it auto mounts the share on bootup. Now I'd like to sync the data on the Samba share onto the laptop share and keep it in sync, so that when I add a file to Samba it also gets added to the laptop.

Reason I want this is for backup purposes and also I'm often away from home for prolonged periods, so its nice to have my media library on my laptop. I know permissions don't get carried over to NTFS, but I'm the only user on the network so its not an issue.

Any suggestions?

Thanks
 
Rsync is difficult to use for two-way sync as you have to write the conflict resolution yourself. I haven't managed that, so get by on one-directional and choosing times when I'm unlikely to be using the computer.

Oh- the laptop is windows? That might make rsync more hassle than it's worth, you'd have to go down the cygwin route. Perhaps I should check the above links too.
 
Hi,

I think the unison tool in unix/Linux will achieve this for you. As already stated rsync will require using tmp folders as a working area so is would be more complex.


David
 
Hi,

I think the unison tool in unix/Linux will achieve this for you. As already stated rsync will require using tmp folders as a working area so is would be more complex.


David

Unison is good! However it's underlying operations are performed via rsync!
 
Unison is good! However it's underlying operations are performed via rsync!

I think they both use the a method of only syncing the chunks of files that have changed. I believe this is the rsync algorithm common to both.
Well hopefully the OP can get his directories all nicely sync'd in the end :)
 
Another +1 for rsync / cron, easy peasy.

Yes, that's what I ended up using, dead easy. Only issue I had (see my other thread) is that the remote mount wasn't there yesterday so it filled up my root disk instead. Got a check in place now to make sure the remote mount is there before it runs.
 
Back
Top Bottom