The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dofullbackup.html Call from Perl No Longer Working

Discussion in 'Data Protection' started by robnelli, May 13, 2014.

  1. robnelli

    robnelli Member

    Joined:
    Apr 16, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    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=username@domaintoo.net&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?
     
    #1 robnelli, May 13, 2014
    Last edited by a moderator: May 13, 2014
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. robnelli

    robnelli Member

    Joined:
    Apr 16, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    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=
    
    arg-4=user@ 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
     
    #3 robnelli, May 13, 2014
    Last edited: May 14, 2014
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page