Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $cp_username = 'username'; // cPanel username
- $cp_password = 'password'; // cPanel password
- $cp_domain = 'example.com'; // Domain name
- $cp_skin = 'crucial'; // cPanel skin (either 'crucial' or 'x3')
- $ftp_username = 'ftp_usernamename'; // Remote FTP username
- $ftp_password = 'ftp_passwordword'; // Remote FTP password
- $ftp_hostname = 'ftp.example.com'; // Remote FTP hostname
- $ftp_mode = 'ftp'; // Remote FTP mode (do not change)
- $notifyemail = 'you@example.com'; // Notification email
- $secure = false; // Use SSL
- $debug = false; // Enable debug
- if($secure) {
- $url = 'ssl://'.$cp_domain;
- $port = 2083;
- } else {
- $url = $cp_domain;
- $port = 2082;
- }
- $socket = fsockopen($url,$port);
- if(!$socket) {
- print 'Failed to open socket connection…bailing out!'."\n";
- exit;
- }
- $auth_string = $cp_username.':'.$cp_password;
- $password = base64_encode($auth_string);
- $params = 'dest='.$ftp_mode.'&email='.$notifyemail.'&server='.$ftp_hostname.'&user='.$ftp_username.'&pass='.$ftp_password.'&submit=Generate Backup';
- fputs($socket, 'POST /frontend/'.$cp_skin.'/backup/dofullbackup.html?'.$params.' HTTP/1.0'."\r\n");
- fputs($socket, 'Host: '.$cp_domain."\r\n");
- fputs($socket, 'Authorization: Basic '.$password."\r\n");
- fputs($socket, 'Connection: Close'."\r\n");
- fputs($socket, "\r\n");
- while(!feof($socket)) {
- $response = fgets($socket, 4096);
- if($debug) {
- echo $response;
- }
- }
- fclose($socket);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement