I've got a library file that I often access, as you would, from the library. eg /library/component.js
But sometimes that needs to be accessed as a copy in a project folder. eg. .../someProject/library/component.js
My problem is that if I update the master version of component.js
I want the many project versions updated also. I don't know where all the project copies are except they do have one root directory which for this discussion let's call /projects
.
The algorithm is:
(1) Search for component.js
in all sub-dirs of /projects
.
(2) Update with master file if newer
(Other build and update functions such as FTP are outside the scope, but a log would be nice.)
Q1: Is there a Linux utility that will snap into action?
Q2: Can anyone suggest a shell script?
(I can do clever MS-DOS batch scripts but I'm a novice when it comes to the Linux command line.)
If the files you are trying to update, are not created and deleted frequently, you can use locate command.
Then you may make use of rsync to update those files one by one. Maybe by traversing the output of the locate command.
p.s.
If you couldn't locate your files, just run "updatedb" command once.