Results 1 to 2 of 2
I have a dedi server so I can write scripts as root and run cron jobs, or use cli as root. pretty standard web hosting structure, each account is a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-20-2013 #1
- 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.
- 05-21-2013 #2
- 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.