#!/usr/local/bin/php -n query('/CMD_API_SITE_BACKUP', array( 'action' => 'backup', 'domain' => $domain, 'form_version' => '4', 'select'.$c++ => 'domain', 'select'.$c++ => 'subdomain', 'select'.$c++ => 'email', 'select'.$c++ => 'email_data', 'select'.$c++ => 'forwarder', 'select'.$c++ => 'autoresponder', 'select'.$c++ => 'vacation', 'select'.$c++ => 'list', 'select'.$c++ => 'emailsettings', 'select'.$c++ => 'ftp', 'select'.$c++ => 'ftpsettings', 'select'.$c++ => 'database', 'select'.$c++ => 'database_data', )); $result = $sock->fetch_parsed_body(); if ( $result['error'] != "0" ) { echo "Error issuing backup creation: ".$result['details']."\n"; exit(1); } //all should be fine. exit(0); function newSock() { global $host; global $port; global $ssl; global $username; global $password; $tsock = new HTTPSocket; $tsock->set_method('POST'); $tsock->set_login($username, $password); if ($ssl) { $tsock->connect("ssl://$host", $port); } else { $tsock->connect("$host", $port); } return $tsock; } ?>