This is a fairly simple problem to explain but it is really annoying me and I could do with some advice. How to I ensure that apache is user : group owner of a dir no matter who uploads to it..
the reason is that WinSCP is used to upload files to
/usr/local/bin/builder and this sets the user to root and the group to root. Don't cry I am logging in as root on WinSCP because it is fine for my purposes. I am happy with it. I understand what I am doing by using it and it's my choice to use it. I have 100+ servers and I don't want to introduce too much complexity so I keep it to this: root logs in on WinSCP if you don't think/want/agree that's great but this question is not for you.
I then have to manually login on putty as root and
# chown -R apache:apache /usr/local/bin/builder in order for apache to have the permissions it needs to this dir. Which apache must or it will cause great evil to befall the server, which will make me have to stop going out or get back into the car at the cinema when I get customers saying the message of doom has reappeared (and I don't go out enough).
How do I make it so that at all times
chown -R apache:apache /usr/local/bin/builder is true? the only way I feel I can do it is using pyinotify to imediately run a script but my heart says there must be a better way - I have also thought of maybe adding some sort of script within WinSCP but I have no idea how to do this and seems rather eventful. One last little addendum:
(PS: crontab-as-a-solution is a joke beyond epic proportions and I won't countenance it, it makes me cringe you considered it! shame on you!)