Laravel Scheduling - Only everyMinute works
It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P
Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1
Schedule entry:
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->daily();
So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?
php laravel cron
add a comment |
It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P
Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1
Schedule entry:
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->daily();
So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?
php laravel cron
add a comment |
It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P
Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1
Schedule entry:
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->daily();
So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?
php laravel cron
It seems that only everyMinute() and cron('* * * * *') are working for me. Any other methods like everyFiveMinutes, everyTenMinutes, daily, dailyAt etc, aren't working at all and always return "No scheduled commands are ready to run". My cron entry is always * * * * * so the other methods should work as well right? And yes; I've actually tried waiting for the other methods including daily, excluding yearly :P
Cron entry: * * * * * /opt/alt/php72/usr/bin/php /home/retracted/domains/retracted/artisan schedule:run >> /dev/null 2>&1
Schedule entry:
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->daily();
So my questions: Why don't the other methods work? How do I make the other methods work, especially daily()?
php laravel cron
php laravel cron
asked Dec 30 '18 at 23:58
TeunissenStefanTeunissenStefan
221114
221114
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.
So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.
So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->everyFiveMinutes();
So with the function ->everyFiveMinutes();
you can run the scheduler every five minutes.
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
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%2f53982421%2flaravel-scheduling-only-everyminute-works%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
So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.
So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.
So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->everyFiveMinutes();
So with the function ->everyFiveMinutes();
you can run the scheduler every five minutes.
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
add a comment |
So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.
So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.
So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->everyFiveMinutes();
So with the function ->everyFiveMinutes();
you can run the scheduler every five minutes.
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
add a comment |
So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.
So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.
So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->everyFiveMinutes();
So with the function ->everyFiveMinutes();
you can run the scheduler every five minutes.
So first you have to run your cronjob every minute that is correct. With that line you run your Laravel scheduler.
So i don't know the scheduler code but it's possible that the code runs only on that minute and not backwards.
So if you need a 5 minute cronjob you have to run your scheduler every minute and then define your duration in your scheduler task.
$schedule->call(function () {
$stat = new Stat();
$stat->users = User::count();
$stat->reviews = Review::count();
$stat->scholen = School::count();
$stat->save();
})->everyFiveMinutes();
So with the function ->everyFiveMinutes();
you can run the scheduler every five minutes.
answered Dec 31 '18 at 2:47
StonyStony
20.2k135264
20.2k135264
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
add a comment |
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
I know that, I said in my post that those methods, like everyFiveMinutes() don't work. Daily should always run at midnight according to the Laravel documentation, and my cron entry is setup for every minute so it should should reach the midnight point and execute this job.
– TeunissenStefan
Dec 31 '18 at 11:04
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%2f53982421%2flaravel-scheduling-only-everyminute-works%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