0

I am trying to back up my database in Laravel using Spatie package. Every thing worked fine till 31 Decemeber 2020 and in New Year my cron job stoped working. I don't know what happened, but on my cPanel mail I am receiving this email:

/usr/local/cpanel/bin/jailshell: -c: line 0: syntax error near unexpected token `newline'
/usr/local/cpanel/bin/jailshell: -c: line 0: `/usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> '

and this is the cron job I am applying:

/usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> /dev/null 2>&1
apokryfos
  • 38,771
  • 9
  • 70
  • 114
Hamza Qureshi
  • 172
  • 2
  • 20
  • Editing in a windows or Mac environment? – tink Jan 24 '21 at 17:40
  • linux cpenal server – Hamza Qureshi Jan 24 '21 at 18:15
  • Where/how did you create the script? – tink Jan 24 '21 at 18:23
  • plz dont mind if i dont unerstand your meaning i think u have no experience about cpanel i have a website which is host by godaday server and this server is installed linux operating system on there server and i only write this comman on there server /usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> /dev/null 2>&1 to take database backup – Hamza Qureshi Jan 24 '21 at 18:37
  • And I'm asking you "How did you write it" ... – tink Jan 24 '21 at 18:52
  • when u perchase hosting services then servise provider provides you facility to write commands on your server in cron jobs we can only register commands there – Hamza Qureshi Jan 24 '21 at 18:55
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/227792/discussion-between-hamza-qureshi-and-tink). – Hamza Qureshi Jan 25 '21 at 12:38

1 Answers1

2

possible solutions

  1. check your php version and php multimanager in cpanel both match or not
  2. go to storage/log/laravel log read cron error
  3. in any controller use

use Illuminate\Support\Facades\Artisan; Artisan::call('backup:run'); dd(Artisan::output()); now you can check your command working or not and able to find errors

Ostaad g
  • 301
  • 1
  • 7