Schedule command issue when using backup:run (Laravel/backup package) #337
Replies: 4 comments 1 reply
-
You could use only
|
Beta Was this translation helpful? Give feedback.
-
Using what i have explained in my last reply, i observed that schedule command works and looping through all tenants by using the landlord connection instead of tenant connection, so instead of making tenant db backup, the command backup the landlord db multiple time (tenants db count). If i use your last proposal how so can run tenant aware jobs ... like if (Tenant::current()) {
$schedule->job(GenerateStats::class)
->dailyAt('1:30')
->onFailure(function () {
Log::error("GenerateStats error");
});
return;
} In fact i'm confused. Thank you |
Beta Was this translation helpful? Give feedback.
-
I solved the issue, by using schedule jobs instead of command.
public function handle()
{
Artisan::call('tenants:artisan', [
'artisanCommand' => 'backup:run --only-db --only-to-disk=spaces'
]);
}
if (Tenant::current()) {
$schedule->job(BackupTenantDatabases::class)
->weeklyOn(1, '03:00');
return;
} |
Beta Was this translation helpful? Give feedback.
-
Hi, when using
php artisan tenants:artisan "backup:run --only-db --only-to-disk=s3"
all works well, but when using schedule command the backup failed
N.B i'm using a cron
Any help will be appreciated
Thank you
Beta Was this translation helpful? Give feedback.
All reactions