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
Cron documentation example contains files which I don't have #778
Comments
Thanks for pointing it out. I'll confirm the answer and get back to you ASAP. |
@pantaoran You are correct. I updated the cron documentation here. Please take a look and close this issue if you're happy with the resolution. |
Thanks for adding that. Please note the following quote from my first post:
You didn't address that part. Is that not supposed to happen? |
Would you mind pasting your current crontab and verifying that |
I cannot find any directory called "magento2-base". Isn't this the same reason as the first problem? |
To be more specific, the following command returns zero hits:
I now created a module with a crontab.xml that's supposed to execute something every minute, but it never gets executed. My cron job only runs How do I get this to work? To fully answer your previous question, here is my cron command, which runs as the magento user (the variables are filled):
|
I'll try to answer your questions but please let me know whether or not this helps and I can try to get additional assistance. If you don't have a Your crontab looks OK although I think you need a second line. Assuming that the environment variable EDIT You also need to run If your Let me know if you have any better results with your custom module and I can look for additional help. |
In your EDIT you recommend to also run You said that message was normal if I don't have that folder, but that seems to contradict your insisting on me running Anyway, you say that that is necessary to run the The rest of your assumptions are correct. My etc/crontab.xml looks like this (slightly anonymized) and I would expect it to run every minute, but after waiting for several minutes I cannot see the expected log messages (which I do see when I run it manually through a CLI command that I created to call the
So in summary I still need help because my custom crontab doesn't seem to be working. Your advice at first seems contradictory and didn't really help :-( |
I referred this question to engineering. Meanwhile, if you haven't done so already, you can ask this to a lot bigger audience by posting it on stackoverflow or magento.stackexchange.com. |
Hi @pantaoran This looks like a bug in the documentation and seems to be already fixed. Update: magento/magento2-base is also available only for Composer-based installation. |
@shiftedreality Thank you. Can you provide any guidance to his crontab.xml question? |
@pantaoran Updated the cron setup page to remove the setup cron job for those that cloned GitHub. |
@pantaoran I would like to ask you about few clarifications:
|
Thank you both for confirming that only the first line in crontab should apply and that all cron functionality should still work correctly based on only Answers:
|
Basic cron tasks are listed here. One of the most common is indexing. |
So I turned all indexers from "Update on save" to "Update by schedule". Then I tried to so some action which would require reindexing, but I failed, the indexers are always green. What I tried are two things: Registering a new customer (which I expected to invalidate the customer grid index) and changing the stock of a product (which I expected to invalidate the Stock index), but like I said they remained green. Why did these actions not bring the expected results? How can I easily invalidate an index to confirm that cron is running the indexers? Starting to feel really stupid with these questions :-( |
The user guide has a list of actions that should cause reindexing. (Read the entire page.) Don't worry about it, we'll do what we can to help you. |
Alright, @shiftedreality I can now confirm that basic cron tasks seem to work fine. I had an outdated index, and once I scheduled my system's cronjob it took 2min and the index was refreshed. |
Closing, feel free to reopen if you still have questions. |
I've installed Magetnto 2.1.9 via composer.
In var/log/setup.cron.log I see next messages every minute:
Please advise if I should keep only 1 line in a crontab. |
I have the same error. in Magento2.2.6 |
This page:
https://github.com/magento/devdocs/blob/develop/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.md
contains instructions that don't work for me. There are three lines in the example:
However, for the second line, I don't have a directory {magento2_root}/update.
And for the third line, when I run that, in the log I get
setup-cron.ERROR: Could not locate magento/magento2-base/composer.json file.
As my installation method I cloned the Magento2 repository and ran the installer. Is this why the regular instructions don't apply to me? Should this case be added to the documentation?
The text was updated successfully, but these errors were encountered: