Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * 13 * * * /usr/bin/php /var/www/path/to/file/database-bkup-test.php &>/tmp/mycroncommand.log
- $today = date('Y-m-d');
- $user = 'db_user';
- $password = 'db_password';
- $host = '127.0.0.1'; //this is actually replaced with an address to another remote server
- $port='3306';
- $database='database_name';
- exec('mysqldump --user='.$user.' --password='.$password.' --host='.$host.' --port='.$port.' '.$database.' > /db-bkup/db-'.$today.'.sql');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement