I have a file abc.txt, it is in a folder /abc/def/.
Another script or program is grabbing this file and saying let's run this!
This program returns an error: we can't use that, you need to permit us.
The files permissions are manually changed, and we run the script again.
The program runs through the code effortlessly: complete, I bet you feel silly for not having the right permissions the first time.
Time passes and the program is required to run again, but this time a replacement file has been FTP'd to the same location with more up to date data, in the process it has passed across with the file its permissions, the incorrect permissions.
The process calls the newly uploaded file and the program is not so happy again.
It kicks out the same error, only this time I feel sillier: You know I can't run that your file permissions are wrong, it's like you don't want me to run this.
At this point I tell the people who are uploading the file that they must change the file permissions before sending the file to the server: We can't do that, {INSERT_EXCUSE}.
It remains my problem to force the uploaded file to have the permissions I require, on file upload.
Q: How can a file or folders permissions be set and then not overwritten by a newly uploaded overwriting file?
I looked into a command setfacl but don't quite understand if it is the right one to use and the arguments passed are not so clear. Hopefully one of the wizards knows what I am to do.