3

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.

2 Answers 2

4

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

2

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

You must log in to answer this question.

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