Jump to content

Super easy and fast way to backup your DB


Recommended Posts

Posted

I created a tiny PHP script which I intended to run through shell to backup my DB. What impressed me is that the script works fine running it from a browser as well. So by using it, at any time, I have within seconds a dump of my DB.


<?php

$command = "mysqldump -u<db_username> -p<db_password> <db_name> | gzip > backupDB_" . date( "H:i:s_d-m-Y" ) . ".sql.gz";

system( $command );

?>



:D

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...