Script to restore the contents from addon domain to a newly created domain (newly created are domain which is seperated from mainaccount)

Script to restore the contents from addon domain to a newly created domain

When customers move from shared hosting to VPS environment/dedi server environment below-pasted script will be usefull. In shared server’s customer’s will be having most of the domain’s as addon domains. Using the below-pasted script they can separate these domains

example1.com. example2.com example3.com (newly created domain which is separated from main account)




#!/bin/bash

b=(example1.com. example2.com example3.com)
a=(username1 Username2 username3)
c=${#a[@]} #length of array
for ((i=0;i<c;i++));do cp -pav /home/mainaccount_username/${b[i]}/* /home/${a[i]}/public_html/; chown -R ${a[i]}. /home/${a[i]}/public_html/* ; done


If you need any further assistance contact me @ [email protected].. prefer hangout ?

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.