I have a HostGator dedicated server running CentOS. I have a folder on one user's account where I want all users to be able to have read access, so we keep it chmod'd to 755. HG has a script that runs and changes these permissions. I had them disable that script, but they also changed an attribute so that the folder was append only, making it impossible to delete a file. They gave me the command to toggle that attribute, but I don't want to have to open a shell every time I want to delete a file from FTP. Is there another way of making it so that I can use that directory like normal, but prevent the permission from being changed?EDIT:After a little back and forth, HG and I have come up with this cronjob that isn't quite right yet. I have an open ticket with them, but sometimes this awesome community is faster.if [[ stat -c \%a /home/user/folder != 755 ]]; then echo -e Perm Changed\n $(stat /home/user/folder) \n | mail -s cron addy@email.com; chmod 755 /home/user/folder; fiThe conditional statement isn't correct and I suspect the quotation marks are out of place but I don't know enough of this syntax to be  sure. Can anyone spot the error here? It is supposed to check the permission of the folder. If they are not 755, then send an email and change the permissions. What I get is as if the condition is alway true.
Prevent directory permission change (or cronjob to work around)
permissions;xattr
Make a cron job that checks the permissions and corrects it. Have it run once per minute.For diagnostics and a work around in one, use this cron that checks for the desired permissions. If they are not found, it sends an email with the results of stat and then corrects the permissions.if [[ $(stat -c \%a /home/user/folder) != 755 ]]; then echo -e Perm Changed\n $(stat /home/user/folder) \n | mail -s Permission Cron addy@email.com; chmod 755 /home/user/folder; fi