Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. * 13 * * * /usr/bin/php /var/www/path/to/file/database-bkup-test.php &>/tmp/mycroncommand.log
  2.  
  3. $today = date('Y-m-d');
  4. $user = 'db_user';
  5. $password = 'db_password';
  6. $host = '127.0.0.1'; //this is actually replaced with an address to another remote server
  7. $port='3306';
  8. $database='database_name';
  9.  
  10. 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