0

I am running Magento 2 on MAMP using PHP 5.6.10 and following this tutorial to create the crontab.

Magento 2 Setup with Crons

When I type sudo crontab -u Phil -e and enter the following...

*/1 * * * * /Applications/MAMP/bin/php/php5.6.10/bin/php -c /Applications/MAMP/bin/php/php5.6.10/conf/php.ini /Users/Phil/sites/magento/bin/magento cron:run >> /Users/Phil/sites/magento/var/log/setup.cron.log&
*/1 * * * * /Applications/MAMP/bin/php/php5.6.10/bin/php -c /Applications/MAMP/bin/php/php5.6.10/conf/php.ini /Users/Phil/sites/magento/update/cron.php >> /Users/Phil/sites/magento/var/log/setup.cron.log&
*/1 * * * * /Applications/MAMP/bin/php/php5.6.10/bin/php -c /Applications/MAMP/bin/php/php5.6.10/conf/php.ini /Users/Phil/sites/magento/bin/magento setup:cron:run >> /Users/Phil/sites/magento/var/log/setup.cron.log&

I get an error Pattern not found 1 * * * *

Any ideas on setting this up ?

1 Answer 1

0

It doesn't matter what directory you're in while creating crontab entries. Simply run:

crontab -e

Then switch to insert mode by typing:

i

Now you can paste in the following:

* * * * * /Applications/MAMP/bin/php/php5.6.10/bin/php -c /Applications/MAMP/bin/php/php5.6.10/conf/php.ini /Users/Phil/sites/magento/bin/magento cron:run >> /Users/Phil/sites/magento/var/log/setup.cron.log&
* * * * * /Applications/MAMP/bin/php/php5.6.10/bin/php -c /Applications/MAMP/bin/php/php5.6.10/conf/php.ini /Users/Phil/sites/magento/update/cron.php >> /Users/Phil/sites/magento/var/log/setup.cron.log&
* * * * * /Applications/MAMP/bin/php/php5.6.10/bin/php -c /Applications/MAMP/bin/php/php5.6.10/conf/php.ini /Users/Phil/sites/magento/bin/magento setup:cron:run >> /Users/Phil/sites/magento/var/log/setup.cron.log&

Now tap on "Esc" key and confirm to exit insert mode. And save the changes by typing

:wq

You will get confirmation:

crontab: installing new crontab

Subsequently, you can verify existing crontab by running:

crontab -l

Answer's rationale: */1 * * * * isn't really valid crontab granularity. You want to run it every minute, which is * * * * *.

2
  • Thank you! Can you help me do this properly....what code shall I use to create CRONTAB and what directory should I be in ?
    – Phil Nind
    Jul 3, 2016 at 16:11
  • Please see updated answer. Hope this helps. Jul 3, 2016 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.