Is This the Correct Cron Job Code to Only Change the Folder Permission from 750 to 755?
The reason is when the .htpasswds/ folder is set to 750, I get 500 Internal Server Errors. When it is set to 755, it works fine without 500 Internal Server Errors.
When I manually change the .htpasswds/ folder to 755, within some time later, the permission is automatically changed back to 750 by the server, resulting in a 500 Internal Server Errors again.
Currently I have about 200 password protected customers directories under the following website directory where my customers can retrieve their reports and photographs:
https://example.com/customers, and I am currently adding more periodically.
However, when my customers or I try to access these directories, we get a 500 Internal Server Error.
After doing some research on Cron jobs on both this site and the web, I came up with the following cron job code using an example found here:
Example Cron Job from (near the bottom of the page):
https://support.capconnect.com/en/knowledgebase/files-permissions-cpanel
Run one of the commands below to change permissions to 755 for the folders and 644 for the files:
cd /home/username/public_html && find -type f | xargs chmod 644 ; find -type d | xargs chmod 755 ; chmod 750 . -c
or
cd /home/username/public_html && find ./ -type f -not -perm 644 -not -name ".ftpquota" -exec chmod 644 -c {} ;; find ./ -type d -not -perm 755 -not -group nobody -exec chmod 755 -c {} ;
For my situation:
Using the example code above, would this be the correct cron job code to change “just” the /.htpasswds folder permission to from 750 to 755?
cd /.htpasswds/public_html/customers && find -type d | xargs chmod 755 ; chmod 750 . -c
My Current Folder Permissions:
.htpasswds = 0750
.htpasswdspublic_html = 0755
.htpasswdspublic_htmlcustomers = 0755
All folders under .htpasswdspublic_html/customers = 0755