-1

Hi i am using spatie(spatie/laravel-backup) package for database backup. Also using nao-pon/flysystem-google-drive package for google drive upload using laravel schedule command. Here is command code

    $schedule->command('database:check')->everyMinute();
    $schedule->command('backup:clean')->everyMinute();
    $schedule->command('backup:run --only-db')->everyMinute();

When i run php artisan schedule:run on my local then i get a zip file on my google drive.But when i run this on cpanel then i didn't get any file in my google drive. Here is code for cron job

/usr/local/bin/php /home/masumcom/binary.masum3.com/artisan 
schedule:run

One command run perfectly but other two not working perfectly

$schedule->command('database:check')->everyMinute();

Only this one working perfectly

apokryfos
  • 38,771
  • 9
  • 70
  • 114
  • Did you check the error logs files for any message? – codedge Jan 22 '21 at 18:07
  • [2021-01-22 18:30:54] local.ERROR: Address in mailbox given [] does not comply with RFC 2822, 3.6.2. {"exception":"[object] (Swift_RfcComplianceException(code: 0): Address in mailbox given [] does not comply with RFC 2822, 3.6.2. at /home/masumcom/binary.masum3.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php:355) – MD Masum Jan 22 '21 at 18:32

1 Answers1

0

try this

/usr/local/bin/php /home/replaceyourdirectoryname/public_html/artisan schedule:run > /dev/null 2>&1

or in any controller try

use Illuminate\Support\Facades\Artisan;
Artisan::call('schedule:run');
dd(Artisan::output()); // here you can see error in or echo Artisan::output();

or go to storage/log/laravel.log read error log

or go to cpanel open mail check error in your mail

or read https://stackoverflow.com/a/65890498/14913109

Hamza Qureshi
  • 172
  • 2
  • 20
  • 1
    Thank's. I have already solved the problem. I have checked laravel log and solved the problem. spatie(spatie/laravel-backup) package send email when the command execute. My email credential is wrong that's why causes the error – MD Masum Jan 26 '21 at 14:38