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" firstname.lastname@example.org; chmod 755 /home/user/folder; fi
The 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.