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.

cron backup job using POST not working anymore ?

Discussion in 'Data Protection' started by solsikkehaven, Feb 22, 2010.

  1. solsikkehaven

    solsikkehaven Registered

    Joined:
    Feb 22, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I've been told (from hostgator support) that after upgrading to cpanel 11.25 - POST is no longer a valid command.

    I've been using a cron job that initiates a script that sends commands to the built in backup feature in each of my clients cpanel's (i'm a reseller) to backup - and send it to my FTP.

    Since last week this has not been working - and this is because POST is not supported ? anymore with cpanel ?

    could someone shed some light over this - and maybe direct me to a solution.

    The script goes something like this (after all the configuration stuff):

    "
    foreach ($sites as $site) {
    if ($secure) {
    $url = "ssl://".$site['domain'];
    $port = 2083;
    } else {
    $url = $site['domain'];
    $port = 2082;
    }
    $socket = fsockopen($url,$port);
    if (!$socket) { echo "Failed to open socket connection… Bailing out!\n"; exit; }
    // Encode authentication string
    $authstr = $site['cpuser'].":".$site['cppass'];
    $pass = base64_encode($authstr);
    $params =
    "dest=$ftpmode&email=$notifyemail&server=$ftphost&user=$ftpuser&pass=$ftppass&port=&rdir
    =$ftpdir&submit=Generate Backup";
    // Make POST to cPanel
    fputs($socket,"POST /frontend/".$site['skin']."/backup/dofullbackup.html?".$params."
    HTTP/1.0\r\n");
    fputs($socket,"Host: {$site['domain']}\r\n");
    fputs($socket,"Authorization: Basic $pass\r\n");
    fputs($socket,"Connection: Close\r\n");
    fputs($socket,"\r\n");
    // Grab response even if we don't do anything with it.
    while (!feof($socket)) {
    $response = fgets($socket,4096);
    if ($debug) echo $response;
    }
    echo "\nDone with {$site['cpuser']}\n";
    fclose($socket);
    // sleep(20);
    }
    ?>"
     
  2. solsikkehaven

    solsikkehaven Registered

    Joined:
    Feb 22, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page