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 : 13.58.105.80


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.php

<?php 
	function backupdb($aobj_context)
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		require_once("cManualMailer.php");
		
	//    $dbhost = 'logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com';
   
	//    $dbuser = 'admin';
	//    $dbpass = 'Logisys2104';
	   
	//   // $myArray = json_decode(sendarr, true);
		
	//    $dbname =stripslashes($_POST['sendarr']);
	   
	// 	$val = explode(',',$dbname);
		
	// 	$phpmailer_path = $aobj_context->main_src."";
		
	//    //$path	= substr_replace($phpmailer_path,'bkp',60));

	// 	for($k=0;$k<count($val);$k++)
	// 	{
	// 		$name[] = $val[$k];
	// 		$backup_file = 'office_'.$val[$k] . '_'.date("Y-m-d") . '.gz';
	// 		$backup_filename.='<br>'.$backup_file;
	// 		$command = "mysqldump --opt -h ".$dbhost." --user ".$dbuser." --password=".$dbpass." ".$val[$k]." | gzip >". $backup_file;
			
	// 		$x = exec($command);
	// 		var_dump($x);
	// 	}
	// 	var_dump($command);
	// 	die();
	// 	$backup_zip="krvw_oasis_".$val[0]."_".date("Y-m-d");
	// 	$command = "zip ".$backup_zip." office_*".date("Y-m-d").'.gz';
	// 	exec($command);
		
	// 	$command = "rm office_*".date("Y-m-d").'.gz';
	// 	exec($command);

	//    echo "<br><a href='{$backup_zip}.zip' style = 'color:blue'>Download file</a>";

	error_reporting(E_ALL);
	ini_set('display_errors', 'On');
   
   $dbhost = 'logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com';
   $dbuser = 'admin';
   $dbpass = 'Logisys2104';
   
  // $myArray = json_decode(sendarr, true);
	
   $dbname =stripslashes($_POST['sendarr']);
   
	$val = explode(',',$dbname);
	
	
	for($k=0;$k<count($val);$k++)
	{
		$name[] = $val[$k];
		$backup_file = 'office_'.$val[$k] . '_'.date("Y-m-d") . '.gz';
		// $backup_filename.='<br>'.$backup_file;
		$command = "mysqldump --opt -h ".$dbhost." --user ".$dbuser." --password=".$dbpass." ".$val[$k]." | gzip >". $backup_file;
		
		exec($command);
	
		// die();
	}
	
	$backup_zip = "office_oasis".date("Y-m-d");
	$command    = "zip ".$backup_zip." office_*".date("Y-m-d").'.gz';
	exec($command);
	
	$command = "rm office_*".date("Y-m-d").'.gz';
	exec($command);
	
	/* 	
	ini_set("display_errors","On");
	require("phpmailer/class.phpmailer.php");
	require("phpmailer/class.smtp.php");
	$mail = new PHPMailer();
	$mail->IsSMTP(); // telling the class to use SMTP
	$mail->SMTPSecure = "ssl";
	$mail->Mailer 	  = "smtp";
	$mail->Host       = "smtp.zoho.com"; // SMTP server    
	$mail->SMTPAuth   = true;                  // enable SMTP authentication
	$mail->Port       = 465;                    // set the SMTP port for the GMAIL server
	$mail->Username   = "support@logisys.org"; // SMTP account username
	$mail->Password   = "logisys124";        // SMTP account password 

	$mail->From     = "support@logisys.org";
	$mail->FromName = "Mohan";
	$mail->AddAddress("support@logisys.org","support@logisys.org");

	$mail->AddReplyTo("support@logisys.org","support@logisys.org");

	$mail->WordWrap = 50;                              // set word wrap
	 
	$mail->IsHTML(true);                               // send as HTML

	$mail->Subject  =  'Backup taken. File name: '.$backup_zip;
	$mail->Body     =  'Backup taken. File name: '.$backup_zip.'. <br>Contains <br> '.$backup_filename;
	$mail->AltBody  =  "This is the text-only body";

	if(!$mail->Send())
	{
	   echo "Message was not sent <p>";
	   echo "Mailer Error: " . $mail->ErrorInfo;
	   exit;
	}
	else
	{	
		echo "Message has been sent";
	} 
	*/
   echo "<br><a href='{$backup_zip}.zip'>Download file</a>";
	}
?>