Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to execute command in the cron? #28

Closed
itnick opened this issue Jun 15, 2014 · 1 comment
Closed

How to execute command in the cron? #28

itnick opened this issue Jun 15, 2014 · 1 comment

Comments

@itnick
Copy link

itnick commented Jun 15, 2014

I am able to execute the command in Terminal like this:
php artisan doSomething

Is the followings correct to execute the command within the cron?

This is my global.php:

Event::listen('cron.collectJobs', function() {
Cron::add('doSomething', '* * * * *', function() {
// Run every minute
Artisan::call('doSomething');
return null;
});
});

But php artisan cron:run always return -1:
+------------+---------+----------+--------+------+
| Run date | In time | Run time | Errors | Jobs |
+------------+---------+----------+--------+------+
| 1402831170 | -1 | -1 | 0 | 0 |
+------------+---------+----------+--------+------+

@itnick
Copy link
Author

itnick commented Jun 15, 2014

Ah... I just solved it.
There's was a lock file generate in app/storage folder.
It works after I remove it.

@itnick itnick closed this as completed Jun 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant