preparing admin route for db backup
This commit is contained in:
parent
950fbe1755
commit
883897ec3c
3 changed files with 516 additions and 0 deletions
23
pfosten/resources/views/admin/backup.php
Normal file
23
pfosten/resources/views/admin/backup.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$DBUSER = $_GET["dbuser"];
|
||||||
|
$DBPASSWD = $_GET["dbpasswd"];
|
||||||
|
$DATABASE = $_GET["database"];
|
||||||
|
#echo("$DBUSER, $DBPASSWD, $DATABASE");
|
||||||
|
//http://localhost:8005/backup?dbuser=user&dbpasswd=passwd&database=db1
|
||||||
|
|
||||||
|
|
||||||
|
$filename = "backup-" . date("d-m-Y") . ".sql.gz";
|
||||||
|
echo($filename);
|
||||||
|
$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);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
@ -102,5 +102,7 @@ Route::post('/league/swap','Leagues\LeaguesController@swapLeagueMembers');
|
||||||
|
|
||||||
Route::get('/league/showSingleUserMatches/user_id={userId}','Leagues\LeaguesController@showSingleUserMatches');
|
Route::get('/league/showSingleUserMatches/user_id={userId}','Leagues\LeaguesController@showSingleUserMatches');
|
||||||
|
|
||||||
|
Route::get('/backup', function() {return view('admin.test');} );
|
||||||
|
|
||||||
/* Cache clearing on remote server */
|
/* Cache clearing on remote server */
|
||||||
Route::get('/clear-cache', function() { Artisan::call('cache:clear');Artisan::call('config:clear'); return "Cache cleared, Config reloaded"; });
|
Route::get('/clear-cache', function() { Artisan::call('cache:clear');Artisan::call('config:clear'); return "Cache cleared, Config reloaded"; });
|
||||||
|
|
|
||||||
491
tools/pfosten_2024-03-16_092001.sql
Normal file
491
tools/pfosten_2024-03-16_092001.sql
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue