Last active
August 12, 2020 15:10
-
-
Save dionedomingo/107b891f9c110b02b0d129255d1cd75c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filename='database_backup_'.date('G_a_m_d_y').'.sql'; | |
$result=exec('mysqldump database_name --password=your_pass --user=root --single-transaction >/var/backups/'.$filename,$output); | |
if($output==''){ | |
echo "done"; | |
/* no output is good */ | |
} | |
else { | |
echo "something went wrong"; | |
echo $output; | |
/* we have something to log the output here*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment