Server Fault is a question and answer site for system and network administrators. 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 2 folders on my Linux OS, Apache 2 Webserver. Call them folderA and folderB . They are have following paths



I would like that whenever a file is added/edited to folderA, a symlink is created/modified in folderB

Is there a way I can do it?

Any help would be appreciated.

share|improve this question
up vote 0 down vote accepted

folderB can be a symlink to folderA.

share|improve this answer
I had one query. If I make folderB symlink to folderA and later add files to folderA, will newly added files to folderA after the symlink has been created be accessible via folderB too? – Loveleen Kaur Sep 15 '10 at 8:18
I checked, they will be..thanks anyways for the help! – Loveleen Kaur Sep 16 '10 at 4:02

I would suggest incron or inotifytools. They will watch for file creation or other activity and take an action that you designate.

share|improve this answer
Agreed. With incron, make a rule that will look like site1/public/sites/all/folderA IN_CREATE,IN_CLOSE_WRITE /path/to/your/script $@ where $@ will contain the path to the created/modified file. Have a look at man 5 incrontab for more info. – ℝaphink Sep 14 '10 at 14:43

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.