/**
	 *  Clones backup by recursive copying directory
	 *
	 * @param \Backup $toClone
	 * @param $destDir
	 * @author : Rafał Trójniak rafal@trojniak.net
	 */
	public function cloneBackup( \Backup $toClone,  $destDir)
	{
		//TODO Implement in native
		exec("cp -r ".escapeshellarg($toClone->getPath())." ".
			escapeshellarg($destDir), $output, $ret);
		if($ret){
			throw new \RuntimeException(
				"Copying failed with return status [".$ret."] and output :\n".
				implode($output)
			);
		}
	}
Exemple #2
0
fwrite($of, "#\n");
fwrite($of, "# FTP: ftp://ftp." . $domain . "/\n");
fwrite($of, "# Gebruikersnaam: " . $username . "\n");
fwrite($of, "# Wachtwoord: " . $password . "\n");
fwrite($of, "#\n\n");
fwrite($of, "Met vriendelijke groet,\nWannahost Support\n");
fclose($of);
echo "/opt/psa/bin/server_pref -u -min_password_strength very_weak\n";
if ($reseller == FALSE) {
    echo "/opt/psa/bin/customer -c {$username} -email {$acctemail} -name {$username} -passwd \"{$password}\"\n";
} else {
    echo "/opt/psa/bin/customer -c {$username} -email {$acctemail} -name {$username} -passwd \"{$password}\" -owner {$reseller}\n";
}
echo "/opt/psa/bin/subscription -c {$domain} -owner {$username} -service-plan \"{$serviceplan_name}\" -ip " . IPv4 . "," . IPv6 . " -login {$username} -passwd \"{$password}\" -seo-redirect none\n";
echo "\n";
echo "/usr/bin/find " . $backup->getPath() . "/domains/" . $domain . "/ -type f -print | xargs -I {} sed -i \"s@/home/" . $username . "/domains/" . $domain . "/public_html@/var/www/vhosts/" . $domain . "/httpdocs@g\" {}\n";
echo "/usr/bin/find " . $backup->getPath() . "/domains/" . $domain . "/ -type f -print | grep configuration.php | xargs -I {} sed -i \"s@ftp_enable = '1'@ftp_enable = '0'@g\" {}\n";
echo "mkdir " . $backup->getPath() . "/domains/" . $domain . "/public_html/webmail/\n";
echo "echo \"Redirect 301 /webmail http://webmail." . $domain . "/\" > " . $backup->getPath() . "/domains/" . $domain . "/public_html/webmail/.htaccess\n";
echo "cd " . $backup->getPath() . "/domains/" . $domain . "/public_html && /usr/bin/lftp -c 'set ftp:ssl-allow false && open ftp://{$username}:\"{$password}\"@localhost && cd httpdocs && mirror --no-symlinks -p -R .'\n";
foreach ($backup->getSubdomains($domain) as $sub) {
    echo "/opt/psa/bin/subdomain -c {$sub} -domain {$domain} -www-root /httpdocs/{$sub} -php true\n";
}
/* We've changed the order for DNS changes. In Plesk an alias domain where DNS Sync is disabled, the domain inherits the zonefile from
    * the parent domain. We want the alias domains to have a clean zonefile, so we perform DNS changes at a later time.
   foreach($dns->getDNSChanges($backup->getPath() . "/backup/" . $domain . "/" . $domain . ".db", $ip) as $dnschange) {
       echo $dnschange . "\n";
   }
    * 
    */
/* END PRIMARY DOMAIN */