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 have a machine (A) behind a firewall with no access to the Internet, on this machine I can NFS mount directories on another machine (B) which can access internet, and is accessible from Internet, but I cannot install anything on this machine (B).

I want to keep a directory on (A) in sync with my Dropbox (that I use on all my other machines (not A or B), all of them connect to Internet regularly).

The solution that I came up with is to have a cron job on (A), to call two rsync commands to sync a directory on (A) with an NFS mounted directory which is actually on (B).

Then I can have a cron job on some other machine on the Internet that syncs my Dropbox with the directory on (B).

Anyone can see any problems with this plan, or has a better suggestion?

Anything other unix utility besides cron and rsync?

share|improve this question
    
Can you run programs on B? If so, what programs are available? If not, how do you hope to use B as a relay between A and the Internet? –  Gilles Nov 25 '11 at 1:13
    
I can SSH into B and can run programs on it, but don't have root access to it, or cannot install anything new on it, it's a rather standard Redhat (or fedora, or centos?!) box. –  Ali Nov 25 '11 at 1:24

1 Answer 1

up vote 4 down vote accepted

You may be able to use Unison to synchronize your files. Unison uses the rsync protocol and can run over ssh. You may need to copy the executable into your directory on the remote system.

Using rsync may cause problems as it is difficult to synchronize file deletions.

EDIT: To sync a folder on A from system C (with working Drobox) a chosen directory on B becomes the hub and A and C two spokes. Schedule the steps so that only one is running at a time.

  • Schedule Unison on system C to sync to the directory on B.
  • Schedule Unison on system A to sync to the directory on B. (May require NFS mounting the directory.)
  • Periodically, check Unison for conflicts if automatic resolution wasn't configured.

There are other ways to handle this. If the directory on B is alway mounted when you need it, then you can skip this step. A symlink to an autofs NFS mount would handle this.

p.s. I was working with WinSCP today, and found it has a synchronize function. It appears to be useful for periodic use. Unison still seems better for automated updates.

share|improve this answer
    
thanks, It looks like Unison is not being actively developed, do you use it or have you used it before? –  Ali Nov 25 '11 at 11:37
1  
I'm using it, and there isn't much left to be done on it. I would only expect bug fixes or platform additions. But I it covers all the platforms I would need. –  BillThor Nov 25 '11 at 13:21
    
I got it and it works perfectly, so basically you are suggesting that i replace rsync with unison? Which is a great suggestion. Still I need to mount my NFS mounts and then use unison to sync them, correct? –  Ali Nov 25 '11 at 14:43
1  
@Ali Use rsync for unidirectional synchronization, unison for bidirectional synchronization. With both utilities, all you need to have is the one binary; even if the system administrator hasn't installed them, you can easily copy that one binary to your account (and if it's not in your default PATH, see How can I set environment variables for a remote rsync process?.) –  Gilles Nov 28 '11 at 0:42

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.