SHARE
TWEET

Untitled

a guest Oct 10th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. #create directory based on date
  3. $path = './'.date('Y-m-d');
  4. #check directory existance
  5. if (!file_exists($path))
  6.     mkdir($path, 0777, true);
  7.  
  8. #initiate database information
  9. $database = 'classicmodels';
  10. $user = 'mysql';
  11. $pass = '';
  12. $host = 'localhost';
  13. #
  14. $dir = $path . '/dump.sql';
  15. echo "<h3>Backing up database to `<code>{$dir}</code>`</h3>";
  16. exec("mysqldump --user={$user} --password={$pass} --host={$host} {$database} --result-file={$dir} 2>&1", $output);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top