Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2003
how to push a file to multiple locations
pretty standard web hosting structure, each account is a username as:
with public_html being the document root for their website
most of them (but an indeterminite and changing number) will have a file as follows:
due to permissions, I have this file replicated on each of these websites; but from time to time I make changes to this or other files. I would like to "push" the newer version of imgreader.php in one folder to all other folders, dynamically. So I would want to write a routine I guess with a command like:
[/home/main/public_html/images]# push imgreader.php
this would then do just that; copy or replace imgreader.php to each /home/*/public_html/images folder and overwrite if found, BUT give it the permissions of its parent folder.
Can someone help me with this? Or is there a simpler command already built into Linux? Thanks - and by the way it'd be great to update a bunch of files like *.JPG or a folder like /icons with this command also.
- Join Date
- Jan 2005
- Saint Paul, MN
The easiest method is to create a group such as "webdevcommon" and include all the users that are allowed to change the source. Put the source in say:
Please note this should work as the user for the file usually is the username for theweb server so it still accesses the file correctly.