Description
Preconditions
- Magento 2.2.0-RC1.1
- PHP 7.0.20
Steps to reproduce
- Execute
git clone -b 2.2.0-RC1.1 --single-branch --depth 1 https://github.com/magento/magento2.git ./magento22-test
cd ./magento22-test
composer install --optimize-autoloader
php bin/magento setup:install \
--backend-frontname=secretadmin \
--session-save=files \
--db-host=localhost \
--db-name=magento22-test \
--db-user=root \
--db-password=secret \
--base-url=https://magento22-test.something/ \
--language=en_US \
--timezone=Europe/Brussels \
--currency=EUR \
--use-rewrites=1 \
--use-secure=1 \
--use-secure-admin=1 \
--admin-use-security-key=1 \
--admin-user=secretadmin \
--admin-password=secret \
--admin-email=email@example.com \
--admin-firstname=Firstname \
--admin-lastname=Lastname \
--cleanup-database
- Now install the cronjobs and look at them:
bin/magento cron:install
crontab -l
Expected result
- Output
#~ MAGENTO START
* * * * * /opt/local/bin/php70 /path/to/magento22-test/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /path/to/magento22-test/var/log/magento.cron.log
#~ MAGENTO END
Actual result
- Output:
#~ MAGENTO START
* * * * * /opt/local/bin/php70 /path/to/magento22-test/bin/magento cron:run 2>&1 | grep -v Ran jobs by schedule >> /path/to/magento22-test/var/log/magento.cron.log
* * * * * /opt/local/bin/php70 /path/to/magento22-test/update/cron.php >> /path/to/magento22-test/var/log/update.cron.log
* * * * * /opt/local/bin/php70 /path/to/magento22-test/bin/magento setup:cron:run >> /path/to/magento22-test/var/log/setup.cron.log
#~ MAGENTO END
Discussion
There are a couple of issues here:
- On the first line, the grep command should contain quotes, but they aren't there, resulting in errors
- The second line, there is no "update" directory, so why is this line added?
- The third line doesn't work properly, the
setup.cron.log
file contains this error:
[2017-06-24 08:31:45] setup-cron.ERROR: Could not locate magento/magento2-base/composer.json file. [] []
Other then that, I know Magento has been advocating to always setup those 3 command, but I never understood why. We've been only using the first line, never the other two. I don't even know what they are supposed to do? There is very little documentation around those. I "suspect" (but haven't verified), that they runs some composer update
commands in the background, so all installed modules are kept up to date. But this is a terrible idea from our point of view, as you are supposed to test updates before rolling them out in production.
If my assumption of those two last commands are correct, then I'd appreciate it if an extra flag to the cron:install
command is added, something like --i-know-what-im-doing
which only creates the first line and doesn't setup the last 2 lines.
Feel free to inform me (and maybe update the devdocs at the same time) with some extra information about those last two commands, maybe I'm mistaken and maybe they are actually useful? :)
Thanks!