Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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.