import-cpanel: issues with nested webroots
If you have a webroot which contains another webroot, you can end up moving the parent before the child has been moved, which errors out.
A workaround would be this, but it will leave copies of the webroots in the old home dir and duplicate content, so will need cleaning up after
if [ $DO_IMPORT ]; then
_bold
echo -n " Creating site $domain..."
mkdir -p /srv/$domain/public
echo ' ok'
echo " Importing site files..."
# rsync -a --info progress2 --remove-source-files $import_directory/$target_htdocs/ /srv/$domain/public/htdocs
rsync -a --info progress2 $import_directory/$target_htdocs/ /srv/$domain/public/htdocs
# rm -rf $import_directory/$target_htdocs
for this_alias in $target_aliases; do
if [ "$this_alias" != "www.$domain" ]; then
echo -n " Adding alias $this_alias to $domain..."
ln -fs /srv/$domain /srv/$this_alias
chown -h sympl:sympl /srv/$this_alias
echo ' ok'
else
echo " Skipping alias $this_alias - automatically added by Sympl"
fi
done
_normal
fi