Super User is a question and answer site for computer enthusiasts and power users. 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'm running Debian and I want to automatically sync changes made in one folder to another folder. Both folders are sub folders of my home folder. This just needs to be one way sync.

I have looked at rsync and I can get what I want by typing the command:

rsync -rv --delete one/ two

I'd just like to have this automatically run so that changes made to one are reflected in the other. I know that rsync can be run as a daemon but I'm not sure of the security configuration I'd need for this and ideally I don't want to have to make these folders visible to all users.

share|improve this question
up vote 2 down vote accepted

You could probably use inosync or incron to trigger off rsync or any other command when the source folder is altered.

I'm familiar with incron so I'll deal with that. Install incron via your package manager. Edit /etc/incron.allow and add the users you want to allow to use incron.

incrontab -e then add the line IN_MODIFY /source/ command replacing command with the rsync command you want to run. See the manpage for incrontab for more ideas on triggers

share|improve this answer

Take a look to the unison project, it's designed for that.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .