Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
Just out of curiousity - is B a computer on a university network or something like that? :) – lindhe May 2 '15 at 22:33
up vote 5 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
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
@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


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.