Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #create directory based on date
- $path = './'.date('Y-m-d');
- #check directory existance
- if (!file_exists($path))
- mkdir($path, 0777, true);
- #initiate database information
- $database = 'classicmodels';
- $user = 'mysql';
- $pass = '';
- $host = 'localhost';
- #
- $dir = $path . '/dump.sql';
- echo "<h3>Backing up database to `<code>{$dir}</code>`</h3>";
- exec("mysqldump --user={$user} --password={$pass} --host={$host} {$database} --result-file={$dir} 2>&1", $output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement