Laravel - What is the usage of schedule time setting when lastly it uses OS cron job?
Laravel docs:
- cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
This Cron will call the Laravel command scheduler every minute. When
the schedule:run command is executed, Laravel will evaluate your
scheduled tasks and runs the tasks that are due.
I run these codes below in appConsoleKernel.php
:
$schedule->job(new AppJobsdone)->everyMinute();
$schedule->command('done:done')->everyMinute();
but none of them worked! so I run the command php artisan schedule:run
but it runs only once and each time I want to make it trigger the job/command I should run that command so I tried to use the command above in Laravel docs. However again it didn't work every minute. So I tried to create a task in Task Scheduler
and run it every 5 minutes(because it didn't have less than 5) now it's working but the usage of ->everyMinute()
is redundant because the schedule of Laravel only runs but the main job that is done is by Windows Task Scheduler. So how can I fix it in order not to use cron job nor windows task scheduler?
Thanks
php laravel schedule
|
show 5 more comments
Laravel docs:
- cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
This Cron will call the Laravel command scheduler every minute. When
the schedule:run command is executed, Laravel will evaluate your
scheduled tasks and runs the tasks that are due.
I run these codes below in appConsoleKernel.php
:
$schedule->job(new AppJobsdone)->everyMinute();
$schedule->command('done:done')->everyMinute();
but none of them worked! so I run the command php artisan schedule:run
but it runs only once and each time I want to make it trigger the job/command I should run that command so I tried to use the command above in Laravel docs. However again it didn't work every minute. So I tried to create a task in Task Scheduler
and run it every 5 minutes(because it didn't have less than 5) now it's working but the usage of ->everyMinute()
is redundant because the schedule of Laravel only runs but the main job that is done is by Windows Task Scheduler. So how can I fix it in order not to use cron job nor windows task scheduler?
Thanks
php laravel schedule
1
You should be able to set every minutes on Windows Task Scheduler : somoit.net/windows/scheduled-task-every-minute
– cbaconnier
Nov 19 '18 at 7:56
That's not the issue, it is OK if that runs every 5 minutes, but the problem is that why we should use Laravel schedule when all the actions can be done with cron job or windows scheduler? why Laravel schedule doesn't run every minute itself or at least to let its task to cron job? it just runs the command which is inside schedule which could be done with anything else in Laravel?
– kodfire
Nov 19 '18 at 8:00
To my understanding, it's mostly to make the whole automation easier. Let's imagine you need a task executed every 15th of the month, it will be hard with only the cron. Maybe you will be able with Windows Task Scheduler. But you will need to configure on every platform you deploy the website. It's easier to set one cron every minute and let Laravel do the rest
– cbaconnier
Nov 19 '18 at 8:08
But you could also usephp artisan done:done
in your Windows Task Schedule and not use the Kernel at all.
– cbaconnier
Nov 19 '18 at 8:10
As I said the problem is that schedule not running every minute. It just runs each time I run commandphp artisan schedule:run
.
– kodfire
Nov 19 '18 at 8:11
|
show 5 more comments
Laravel docs:
- cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
This Cron will call the Laravel command scheduler every minute. When
the schedule:run command is executed, Laravel will evaluate your
scheduled tasks and runs the tasks that are due.
I run these codes below in appConsoleKernel.php
:
$schedule->job(new AppJobsdone)->everyMinute();
$schedule->command('done:done')->everyMinute();
but none of them worked! so I run the command php artisan schedule:run
but it runs only once and each time I want to make it trigger the job/command I should run that command so I tried to use the command above in Laravel docs. However again it didn't work every minute. So I tried to create a task in Task Scheduler
and run it every 5 minutes(because it didn't have less than 5) now it's working but the usage of ->everyMinute()
is redundant because the schedule of Laravel only runs but the main job that is done is by Windows Task Scheduler. So how can I fix it in order not to use cron job nor windows task scheduler?
Thanks
php laravel schedule
Laravel docs:
- cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
This Cron will call the Laravel command scheduler every minute. When
the schedule:run command is executed, Laravel will evaluate your
scheduled tasks and runs the tasks that are due.
I run these codes below in appConsoleKernel.php
:
$schedule->job(new AppJobsdone)->everyMinute();
$schedule->command('done:done')->everyMinute();
but none of them worked! so I run the command php artisan schedule:run
but it runs only once and each time I want to make it trigger the job/command I should run that command so I tried to use the command above in Laravel docs. However again it didn't work every minute. So I tried to create a task in Task Scheduler
and run it every 5 minutes(because it didn't have less than 5) now it's working but the usage of ->everyMinute()
is redundant because the schedule of Laravel only runs but the main job that is done is by Windows Task Scheduler. So how can I fix it in order not to use cron job nor windows task scheduler?
Thanks
php laravel schedule
php laravel schedule
asked Nov 19 '18 at 7:52
kodfirekodfire
1127
1127
1
You should be able to set every minutes on Windows Task Scheduler : somoit.net/windows/scheduled-task-every-minute
– cbaconnier
Nov 19 '18 at 7:56
That's not the issue, it is OK if that runs every 5 minutes, but the problem is that why we should use Laravel schedule when all the actions can be done with cron job or windows scheduler? why Laravel schedule doesn't run every minute itself or at least to let its task to cron job? it just runs the command which is inside schedule which could be done with anything else in Laravel?
– kodfire
Nov 19 '18 at 8:00
To my understanding, it's mostly to make the whole automation easier. Let's imagine you need a task executed every 15th of the month, it will be hard with only the cron. Maybe you will be able with Windows Task Scheduler. But you will need to configure on every platform you deploy the website. It's easier to set one cron every minute and let Laravel do the rest
– cbaconnier
Nov 19 '18 at 8:08
But you could also usephp artisan done:done
in your Windows Task Schedule and not use the Kernel at all.
– cbaconnier
Nov 19 '18 at 8:10
As I said the problem is that schedule not running every minute. It just runs each time I run commandphp artisan schedule:run
.
– kodfire
Nov 19 '18 at 8:11
|
show 5 more comments
1
You should be able to set every minutes on Windows Task Scheduler : somoit.net/windows/scheduled-task-every-minute
– cbaconnier
Nov 19 '18 at 7:56
That's not the issue, it is OK if that runs every 5 minutes, but the problem is that why we should use Laravel schedule when all the actions can be done with cron job or windows scheduler? why Laravel schedule doesn't run every minute itself or at least to let its task to cron job? it just runs the command which is inside schedule which could be done with anything else in Laravel?
– kodfire
Nov 19 '18 at 8:00
To my understanding, it's mostly to make the whole automation easier. Let's imagine you need a task executed every 15th of the month, it will be hard with only the cron. Maybe you will be able with Windows Task Scheduler. But you will need to configure on every platform you deploy the website. It's easier to set one cron every minute and let Laravel do the rest
– cbaconnier
Nov 19 '18 at 8:08
But you could also usephp artisan done:done
in your Windows Task Schedule and not use the Kernel at all.
– cbaconnier
Nov 19 '18 at 8:10
As I said the problem is that schedule not running every minute. It just runs each time I run commandphp artisan schedule:run
.
– kodfire
Nov 19 '18 at 8:11
1
1
You should be able to set every minutes on Windows Task Scheduler : somoit.net/windows/scheduled-task-every-minute
– cbaconnier
Nov 19 '18 at 7:56
You should be able to set every minutes on Windows Task Scheduler : somoit.net/windows/scheduled-task-every-minute
– cbaconnier
Nov 19 '18 at 7:56
That's not the issue, it is OK if that runs every 5 minutes, but the problem is that why we should use Laravel schedule when all the actions can be done with cron job or windows scheduler? why Laravel schedule doesn't run every minute itself or at least to let its task to cron job? it just runs the command which is inside schedule which could be done with anything else in Laravel?
– kodfire
Nov 19 '18 at 8:00
That's not the issue, it is OK if that runs every 5 minutes, but the problem is that why we should use Laravel schedule when all the actions can be done with cron job or windows scheduler? why Laravel schedule doesn't run every minute itself or at least to let its task to cron job? it just runs the command which is inside schedule which could be done with anything else in Laravel?
– kodfire
Nov 19 '18 at 8:00
To my understanding, it's mostly to make the whole automation easier. Let's imagine you need a task executed every 15th of the month, it will be hard with only the cron. Maybe you will be able with Windows Task Scheduler. But you will need to configure on every platform you deploy the website. It's easier to set one cron every minute and let Laravel do the rest
– cbaconnier
Nov 19 '18 at 8:08
To my understanding, it's mostly to make the whole automation easier. Let's imagine you need a task executed every 15th of the month, it will be hard with only the cron. Maybe you will be able with Windows Task Scheduler. But you will need to configure on every platform you deploy the website. It's easier to set one cron every minute and let Laravel do the rest
– cbaconnier
Nov 19 '18 at 8:08
But you could also use
php artisan done:done
in your Windows Task Schedule and not use the Kernel at all.– cbaconnier
Nov 19 '18 at 8:10
But you could also use
php artisan done:done
in your Windows Task Schedule and not use the Kernel at all.– cbaconnier
Nov 19 '18 at 8:10
As I said the problem is that schedule not running every minute. It just runs each time I run command
php artisan schedule:run
.– kodfire
Nov 19 '18 at 8:11
As I said the problem is that schedule not running every minute. It just runs each time I run command
php artisan schedule:run
.– kodfire
Nov 19 '18 at 8:11
|
show 5 more comments
1 Answer
1
active
oldest
votes
Just so you can close the question.
As I said in the comments / chat
- You should be able to set every minutes on Windows Task Scheduler:
http://somoit.net/windows/scheduled-task-every-minute
- You can also use
php artisan done:done
in your Windows Task Schedule and not use the Laravel Kernel at all. - For the fact that
everyMinute()
is ignored when you run the job manually is because Laravel know that a cron can't be executed more than once a minute. So it doesn't keep a trace for a job set toeveryMinute()
. This mean, every time you run the commandphp artisan schedule:run
it will run the job.
And has @kyslik mentioned in the chat : The scheduler is well covered in the official documentation: https://laravel.com/docs/5.7/scheduling#introduction
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370391%2flaravel-what-is-the-usage-of-schedule-time-setting-when-lastly-it-uses-os-cron%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just so you can close the question.
As I said in the comments / chat
- You should be able to set every minutes on Windows Task Scheduler:
http://somoit.net/windows/scheduled-task-every-minute
- You can also use
php artisan done:done
in your Windows Task Schedule and not use the Laravel Kernel at all. - For the fact that
everyMinute()
is ignored when you run the job manually is because Laravel know that a cron can't be executed more than once a minute. So it doesn't keep a trace for a job set toeveryMinute()
. This mean, every time you run the commandphp artisan schedule:run
it will run the job.
And has @kyslik mentioned in the chat : The scheduler is well covered in the official documentation: https://laravel.com/docs/5.7/scheduling#introduction
add a comment |
Just so you can close the question.
As I said in the comments / chat
- You should be able to set every minutes on Windows Task Scheduler:
http://somoit.net/windows/scheduled-task-every-minute
- You can also use
php artisan done:done
in your Windows Task Schedule and not use the Laravel Kernel at all. - For the fact that
everyMinute()
is ignored when you run the job manually is because Laravel know that a cron can't be executed more than once a minute. So it doesn't keep a trace for a job set toeveryMinute()
. This mean, every time you run the commandphp artisan schedule:run
it will run the job.
And has @kyslik mentioned in the chat : The scheduler is well covered in the official documentation: https://laravel.com/docs/5.7/scheduling#introduction
add a comment |
Just so you can close the question.
As I said in the comments / chat
- You should be able to set every minutes on Windows Task Scheduler:
http://somoit.net/windows/scheduled-task-every-minute
- You can also use
php artisan done:done
in your Windows Task Schedule and not use the Laravel Kernel at all. - For the fact that
everyMinute()
is ignored when you run the job manually is because Laravel know that a cron can't be executed more than once a minute. So it doesn't keep a trace for a job set toeveryMinute()
. This mean, every time you run the commandphp artisan schedule:run
it will run the job.
And has @kyslik mentioned in the chat : The scheduler is well covered in the official documentation: https://laravel.com/docs/5.7/scheduling#introduction
Just so you can close the question.
As I said in the comments / chat
- You should be able to set every minutes on Windows Task Scheduler:
http://somoit.net/windows/scheduled-task-every-minute
- You can also use
php artisan done:done
in your Windows Task Schedule and not use the Laravel Kernel at all. - For the fact that
everyMinute()
is ignored when you run the job manually is because Laravel know that a cron can't be executed more than once a minute. So it doesn't keep a trace for a job set toeveryMinute()
. This mean, every time you run the commandphp artisan schedule:run
it will run the job.
And has @kyslik mentioned in the chat : The scheduler is well covered in the official documentation: https://laravel.com/docs/5.7/scheduling#introduction
answered Nov 19 '18 at 11:09
cbaconniercbaconnier
1,0201722
1,0201722
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370391%2flaravel-what-is-the-usage-of-schedule-time-setting-when-lastly-it-uses-os-cron%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You should be able to set every minutes on Windows Task Scheduler : somoit.net/windows/scheduled-task-every-minute
– cbaconnier
Nov 19 '18 at 7:56
That's not the issue, it is OK if that runs every 5 minutes, but the problem is that why we should use Laravel schedule when all the actions can be done with cron job or windows scheduler? why Laravel schedule doesn't run every minute itself or at least to let its task to cron job? it just runs the command which is inside schedule which could be done with anything else in Laravel?
– kodfire
Nov 19 '18 at 8:00
To my understanding, it's mostly to make the whole automation easier. Let's imagine you need a task executed every 15th of the month, it will be hard with only the cron. Maybe you will be able with Windows Task Scheduler. But you will need to configure on every platform you deploy the website. It's easier to set one cron every minute and let Laravel do the rest
– cbaconnier
Nov 19 '18 at 8:08
But you could also use
php artisan done:done
in your Windows Task Schedule and not use the Kernel at all.– cbaconnier
Nov 19 '18 at 8:10
As I said the problem is that schedule not running every minute. It just runs each time I run command
php artisan schedule:run
.– kodfire
Nov 19 '18 at 8:11