Open thearabbit opened 10 years ago
try this Artisan::call('db:backup',['filename' => 'theara.sql']);
The suggested code by @anton-ko does not work for me, I get the following error The "filename" argument does not exist.
Worked when I've called as follows:
Artisan::call("db:backup", ["--filename" => "test.sql"]);
none of the solutions provided here work for me -- I cannot seem to set a filename, with or without hyphens. I also cannot set a path, though I'm not sure if the filename parameter is meant to do that.
If I do use hyphens, I get the "filename" argument does not exist error. If I don't use hyphens, I don't get that error but it still doesn't work.
I can use the no-parameter version of the db:backup command with success.
@z0d14c If it helps, this is what my code looks like, and it is has been working for me sense November of last year (I make frequently backups).
Artisan::call("db:backup", [
"--filename" => $filename,
"--gzip" => "",
"--local-path" => $fileLocation,
"--cleanup" => ""
]);
I faced this problem too try this
Artisan::call('db:backup',['dump' => 'theara.sql']);
This is not working for me, please help:
$execValue = Artisan::call("db:backup", [ "--destination" => "dropbox", "--destinationPath" => "/db_", "--timestamp" => "Y-m-d H:i:s", "--compression" => "gzip", ]); // THIS IS NOT WORKING :(
I am creating backups with schedule using but what I want to do is force the backup in some specific times.
$schedule->command('db:backup --database=mysql --destination=dropbox --destinationPath=/db_ --timestamp="Y-m-d H:i:s" --compression=gzip') ->twiceDaily(8,18); // THIS IS WORKING
SOLVED:
$execValue = Artisan::call("db:backup", [ "--database" => "mysql", // This missed "--destination" => "dropbox", "--destinationPath" => "/db_", "--timestamp" => "Y-m-d H:i:s", "--compression" => "gzip", ]);
I would like to call
php artisan db:backup theara.sql
with custom file name from route or controller like this:I do like this because i want to get file name after generate backup file. And then i have problem when restore it
Pl help me.