Set ownership and rights on folders recursive with bash script

Create a file in your home folder and add the following skeleton script and save the script as "set_rights", or something.

#!/bin/bash
clear
echo "Set ownership and read write rights"
chown -R my_usergroup:my_usergroup  /home/httpd/domain1/sites/all/
chown -R my_usergroup:my_usergroup  /home/httpd/domain2/sites/all/

chmod -R 755  /home/httpd/domain1/sites/all/
chmod -R 755  /home/httpd/domain2/sites/all/    

echo "chown -R my_usergroup:my_usergroup AND chmod -R 755"

echo "/home/httpd/domain1/sites/all"
echo "/home/httpd/domain2/sites/all"

Run the script by by typing:

./set_rights
Knowledge keywords: