1

In the app/console/kernel.php file I have this:

    Log::notice('schedule start');
    $available_input = array('info1','info12','info13','info14','info15','info16','info17','info18','info19','info11','info1','info2','info3','info4','info5','info6','info7','info8','info9','info20');
    foreach ($available_input as $port_key => $input) {

             $schedule->exec("sh /home/user1/subfolder/script.sh $input")->withoutOverlapping()->appendOutputTo(storage_path('logs/script_info.log'));
    }
    Log::notice('schedule end');

And in script.sh file

#!/bin/sh
echo `date "+%Y-%m-%d %r: Script Starts for $1"`
if [ $# -eq 1 ]
    then
    echo `date "+%Y-%m-%d %r: Script Working for $1"`
    sleep 2m

else
    echo "invalid argument"
fi
echo `date "+%Y-%m-%d %r: Script Completed"`

Then i started the script from crontab using following code

* * * * * php /var/www/localapp.com/api/artisan schedule:run >> /home/user1/subfolder/scheduler_info.log 2>&1

its working properly. But its misbehaving even there is no trigger from cron. ie., after stopping cron still the process it executing the schedulers. i can see logs still adding.

MMM
  • 36
  • 1
  • 4

0 Answers0