Copy files under all subdomains/addon domains

The following script will help you to Copy the files under all the subdomains/addon domains hosted under single user hosting account. For example you want to copy the file from /home/username/public_html to subdomains and addon domains on the same account then run the following commands from the shell.

for i in `grep –exclude=”*.cache” documentroot /var/cpanel/userdata/username/* | cut -d: -d’ ‘ -f2-` ;do cp -p /home/username/public_html/filename $i/ ;done

Make sure that you have replaced the username with the original account’s username and file name with the name of the file which you want to copy under the subdomains and addon domains.