...
This commit is contained in:
parent
2cf04fdf20
commit
1fe0ac690c
1 changed files with 20 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
```php
|
||||
<?php
|
||||
|
||||
$DBUSER="user";
|
||||
$DBPASSWD="password";
|
||||
$DATABASE="user_db";
|
||||
|
||||
$filename = "backup-" . date("d-m-Y") . ".sql.gz";
|
||||
$mime = "application/x-gzip";
|
||||
|
||||
header( "Content-Type: " . $mime );
|
||||
header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
|
||||
|
||||
$cmd = "mysqldump -u $DBUSER --password=$DBPASSWD $DATABASE | gzip --best";
|
||||
|
||||
passthru( $cmd );
|
||||
|
||||
exit(0);
|
||||
?>
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue