0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.189.189.19


Current Path : /proc/thread-self/root/var/www/html/reva/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/reva/src/backup_1.php

<?php

error_reporting(-1);
ini_set('display_errors', 'On');
include("/var/www/config.php");
function backupdb_1($aobj_context)
{
        set_time_limit(300);

        $final_array = $_POST['final_array'];
        $final_array = json_decode($final_array); 
        array_map('unlink', glob($aobj_context->main_src.'backup/*.sql'));
        $dbhost = SERVERNAME;
        $dbuser = USERNAME;
        $dbpass = PASSWORD;



        $files = $final_array;
        // var_dump($files);
        // die();     
        for ($i=0; $i<count($files); $i++) {
                $cnd = $aobj_context->main_src.'backup/'.$files[$i].'.sql';                      
                $command='mysqldump --opt -h'.$dbhost.' -u'.$dbuser.' -p'.$dbpass.' logisys3_rcu '.$files[$i].' > '.$cnd.'';
                $res = exec($command);
                // var_dump($cnd);
        }        


        $zipname = './backup/bkpzip'.date("Y-m-d-h-i-s").'.zip';
        $zip = new ZipArchive;
        $zip->open($zipname, ZipArchive::CREATE);        



        foreach (glob($aobj_context->main_src.'backup/*.sql') as $file) {
                $zip->addFile($file, basename($file));
                // var_dump($file);
        }
       
        $zip->close();
        
       if($zipname){                
               $arr['status'] = 'Backup Successfull';
               echo json_encode($arr);
               return;
       }
              


}


function delete_zip($aobj_context){
        $del = $_POST["del"];
        
        $delete_path = $aobj_context->main_sr.'backup/'."$del";
        

        if(unlink($delete_path)){
                $data = 1;
                
               echo json_encode($data);

        }else{
                
                $data = 0;
                echo json_encode($data);

        }
        


        
}


?>