Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Other options for "Fileman"

Discussion in 'Data Protection' started by Cassiano Aquino, Dec 7, 2017.

  1. Cassiano Aquino

    Cassiano Aquino Registered

    Joined:
    Dec 7, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Reseller Owner
    Hi, i have been using Fileman-fullbackup for long time, and it´s great, but now i need to make backups only for databases and files ( my website files ).

    Sorry, but i tried to find if theres is such option, but no luck.

    Is there possible?

    Thanks in advance!



    Code:
    for ( $row = 0; $row < count( $clientes ); $row++ ) {
        
        $IDVAR++;
        
        # Credentials for cPanel account
        $source_server_ip = $clientes[$row]['FTPhost'];  # Server IP or domain name eg: 212.122.3.77 or cpanel.domain.tld
        $cpanel_account   = $clientes[$row]['FTPuser'];  # cPanel username
        $cpanel_password  = $clientes[$row]['FTPpass'];  # cPanel password
        $cx[]             = $source_server_ip;
        
        
        $xmlapi = new xmlapi($source_server_ip);
        $xmlapi->set_debug(0);
        $xmlapi->password_auth(trim($cpanel_account),trim($cpanel_password));
        $xmlapi->set_port('2083');
        $xmlapi->set_output('array');
        
        
         $api_args = array(
                       'ftp',
                       $source_server_ip,
                       $ftpacct,
                       $ftppass,
                       $email_notify,
                       21,
                       '/'.$dir.'/'
                     );
    
        $query = $xmlapi->api1_query($cpanel_account,'Fileman','fullbackup',$api_args);
        
        
        $spitDebug  .= '--------------------------------------------------------------------------------------------';
        if( $query['data']['result'] == 0 ){
          
           $spitDebug .= "\n ACONTECEU UM ERRO AO FAZER O BKP \n ";
           $spitDebug .= $query['data']['reason'] . " \n ";
           #$spitDebug .= "<pre>";
           $spitDebug .= " \n  <".strtoupper($cpanel_account)."> \n" . print_r($query, true)."  \n";
           #$spitDebug .= "</pre>";
          
           $ListClientes .= "\n  ".$source_server_ip." - [FALSE]=[".$query['data']['reason']."]";
          
           $RetError  +=1;
          
        } else {
            
            $spitDebug .= " \n BACKUP EFETUADO COM SUCESSO! \n ";
            #$spitDebug .= "<pre>";
            $spitDebug .= " \n  <".strtoupper($cpanel_account)."> \n" . print_r($query, true)."  \n";
            #$spitDebug .= "</pre>";
            
            $ListClientes .= "\n  ".$source_server_ip." - [TRUE]";
            
            
        }
        
        $spitDebug  .= '--------------------------------------------------------------------------------------------';
        unset($xmlapi); 
        
        if( ($IDVAR%2)==0 ){
           sleep(3);       # Estava dando alguns problemas com contas que não concluiam o BKP, por isso coloquei este sleep(), com isso, o problema foi resolvido ( não faço ideia porque :P ).
        } else {
            sleep(4);      # Algumas contas estavam dando problema ( User root already has more than 'max_user_connections' active connections  )
        }
    
    }
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,455
    Likes Received:
    1,608
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    There are no API functions that support what you are seeking at this time, so you'd need to develop a custom bash script that makes use of the mysqldump and rsync utilities. Additionally, I encourage you to vote and add feedback to the following feature request if this is something you'd like to see supported directly through a UAPI function:

    API for Databases Only and Files Only Backup

    Thank you.
     
Loading...

Share This Page