Dofullbackup.html Call from Perl No Longer Working

robnelli

Member
Apr 16, 2004
14
0
151
I'm a user with a reseller account on a typical web hosting provider. My provider recently moved my account to a new server with Cpanel 11.42.1 installed. For years, I have been doing my own accounts backups to a remote server using Cpanel dofullbackup from a Perl script running on cron nightly. I have the cron job do a backup of one account per night. Since the move to the new server, dofullbackup doesn't seem to run. I use the following code snippet:

Code:
	$authstr = "$account:$passwd";
	$cPanelUidPass = encode_base64($authstr);

# Get the port address

	$iaddr = inet_aton($whmServer);
	$paddr = sockaddr_in($whmPortNumber , $iaddr);

# Create the socket, connect to the port

	socket(SOCKET, PF_INET, SOCK_STREAM, 0) or die "Socket failed for client account: $account[$i]: $!";
	connect(SOCKET, $paddr) or die "Connect failed for client account: $account[$i]: $!";
	autoflush SOCKET (1);

# Request dofullbackup of account

  $params = "?dest=$remote_dest&email=$email&server=$server&user=$user&pass=$pass&port=$port&rdir=$rdir";
	print SOCKET "GET /frontend/x3/backup/dofullbackup.html$params\r\n";
	print SOCKET "HTTPS/1.0\r\n";
  print SOCKET "Host: $domain \r\n");
	print SOCKET "Authorization: Basic $cPanelUidPass \r\n";
	print SOCKET "Accept: text/html; */*\n";
	print SOCKET "Connection: close\r\n\r\n";
I can kickoff the process sudomaintoo.com&port=21&rdir=Backups&user=supersof&pass=xxxxxxxx

When I run my script with some write statements, this is what I see:

Code:
>> Remote Backup Begun at 20:14:01 on May 12 2014 <<
--- Processing client account 1: jrnhosti 
--- authstr: username:xxxxxxxx 
--- domain: domain.net 
--- cPanelUidPass: anJuaG9zdGk6bGVlbmllLTE= 
>> domain.net Backup Started at 20:14:01 on May 12 2014 <<
--- GET
/frontend/x3/backup/dofullbackup.html?dest=passiveftp&[email protected]&server=nj01.domain.com&port=21&rdir=Backups&user=supersof&pass=xxxxxxxx
--- HTTPS/1.0 
--- Host: domain.net 
--- Authorization: Basic anJuaG9zdGk6bGVlbmllLTE=
--- Accept: text/html; */*
--- Connection: close
>> domain.net Backup Ended at 20:14:01 on May 12 2014 <<
>> Remote Backup Completed at 20:15:31 on May 12 2014 <<
Everythiing looks ok, but the dofullbackup just doesn't seem to execute. I've also tried running as POST. Is there something new in releaser 11.42.1 that would account for dofullbackup not running?
 
Last edited by a moderator:

robnelli

Member
Apr 16, 2004
14
0
151
Thanks for the lead. I tried using one of the scripts shown using the cPanel::PublicAPI.pm and got similar results, but at least some detail to what the problem might be, although I don't know how to resolve it. The results returned using the debug option are below. I'm assuming my web hosting provider changed something when they moved my sites to the new server. Can anyone point to what might have changed from the messages below that I can have my provider look into?

Code:
debug: Using user param from object creation
debug: Using pass param from object creation
debug: loaded serializer: JSON::Syck
debug: api_request: ( cPanel::PublicAPI=HASH(0x15f8f80), cpanel, /xml-api/cpanel, POST, HASH(0x15f8ef0),  )
debug: failed to load encoder: cPanel/CPAN/URI/Escape.pm
debug: loaded encoder: URI/Escape.pm
debug: Found port for service cpanel to be 2082 (usessl=0)
debug: POST /xml-api/cpanel HTTP/1.1
Host: http://www.domain.net
Connection: Close
Content-Length: 238
User-Agent: cPanel::PublicAPI (perl) 1.002
Authorization: Basic anJuaG9zdGk6bGVlbmllLTE=

[email protected] domain.net&cpanel_xmlapi_module=Fileman&cpanel_xmlapi_cpanel_xmlapi_user=&arg-0=ftp&arg-3=
xxxxxxxx&cpanel_xmlapi_apiversion=1&arg-1=nj01.domain.com&arg-6=%252F&arg-2=supersof&arg-5=21&cpanel_xmla
pi_func=fullbackup
debug: HTTP LINE[HTTP/1.1 403 Forbidden Access denied
]
debug: HEADER[content-type]=[text/xml]
debug: HEADER[connection]=[close]
debug: HEADER[server]=[cpsrvd/11.42.1.13]
debug: READ TYPE=close
Server Error from domain.net: HTTP/1.1 403 Forbidden Access denied
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
It looks like you have asked that question on the other thread, so I will leave it to be answered there.

Thank you.