Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to setup a system where a laptop and a desktop computers coexist.
The idea is, I bring the laptop into the network and the laptop syncs the /home directory( with some exceptions) with the desktop computer, then the desktop computer mounts a stack with his copy of /home on top and the laptop copy(nfs) in the bottom.

So, obviously I don't need a write-through strategy, a write-back with a quite big cache solution would suit me way better.

I've been reading on unionfs and aufs and others but I either don't understand how or I can't do this with those fs.

Any ideas?

share|improve this question
    
It sounds like you're looking for something like drbd (not a filesystem) or perhaps Andrew FS or Coda (are these even in use these days?). Or perhaps you could do it the quick and dirty way, and run a couple of rsyncs to do the job. –  Alexios May 22 '12 at 21:32
    
Can you also describe the usage scenario that you are envisioning? You mention a few implementation details but I do not understand why you want to use those. E.g. why do you want to nfs mount the laptop copy? Why do you want to sync the /home directory. Sync from the desktop to the laptop or the other way around? Do you trash the data that is already on the target when syncing, or is this a bi-directional sync? –  chutz May 24 '12 at 3:21
    
Use the laptop on the move, sync it when arrive home and then use the desktop only, I am just very interested on removing the extra step that would be required to sync the desktop back to the laptop before unplugging it, I'd like this to be continuous. –  Arkaitz Jimenez May 24 '12 at 7:43
add comment

3 Answers

With software such as Csync, you could use the module pam_csync to SFTP sync the laptop on login and logout.

Another method might be to run lsyncd to rsync your home directory periodically. Unfortunately this uses inotify and can be untenable if you have hundreds of thousands of files in the watched directory. A better solution might use fsnotify or the fanotify API and then sync bi-directionally periodically, but I haven't found one yet.

Lastly if it's under 1-2GB that you need to keep in sync, there are good LAN sync functionalities in Dropbox.

share|improve this answer
add comment

I use bittorrent sync - working nice local and remote...

Maybe also worth taking a look.

share|improve this answer
add comment

You could consider using git-annex, nowadays it comes with a nice web interface too :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.