I don't have much knowledge in Magento, but I'm spending a lot of time trying to set up crontab. I tried to follow the steps available on the Magento website, but early on when I try to run the command bin/magento cron: install --force I already come across an error that I can't solve. I use Professional Cloud Server from Hostinger. Can someone help me?

As you can see.


Make sure the crontab is configured

crontab -l

A sample follows:

* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run | grep -v Ran jobs by schedule >> /var/www/html/magento2/var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log

Refer devDoc Cron config

Please check and let me know. Happy to contribute

  • When I try this command, it returns the value no crontab for XXXX – Dalvan Miotto Sep 11 at 15:21

I am getting this errors on System.log when i tried to install crontab

[2019-09-12 03:34:26] main.ERROR: crontab -l 2>&1
sh: crontab: command not found [] []
[2019-09-12 03:34:26] main.ERROR: crontab -l 2>&1
sh: crontab: command not found [] []
[2019-09-12 03:34:26] main.ERROR: echo "
#~ MAGENTO START da443c770a0a427b27f1b25a935f0f97
* * * * * /opt/alt/php71/usr/bin/php /home/u225447137/domains/nictarpod.com.br/public_html/bin/magento cron:run 2>&1 | grep -v \"Ran jobs by schedule\" >> /home/u225447137/domains/nictarpod.com.br/public_html/var/log/magento.cron.log
* * * * * /opt/alt/php71/usr/bin/php /home/u225447137/domains/nictarpod.com.br/public_html/update/cron.php >> /home/u225447137/domains/nictarpod.com.br/public_html/var/log/update.cron.log
* * * * * /opt/alt/php71/usr/bin/php /home/u225447137/domains/nictarpod.com.br/public_html/bin/magento setup:cron:run >> /home/u225447137/domains/nictarpod.com.br/public_html/var/log/setup.cron.log
#~ MAGENTO END da443c770a0a427b27f1b25a935f0f97
" 2>&1 | crontab - 2>&1
sh: line 6: crontab: command not found [] []

Any one? please!


There is either no crontab command for your environment or you couldn't access it.

Please type in the terminal:

which crontab

which should return something like below:

~ $ which crontab


Since your system return that statement for alias, alias is a way to link a command/function to execute another command/function.

add this into your ~/.bashrc or ~/.profile or ~/.bashprofile depends on your environement

alias crontab='__crontab'

see https://askubuntu.com/questions/17536/how-do-i-create-a-permanent-bash-alias

  • I tried using this command and got this answer. alias crontab='__crontab' Any Idea? – Dalvan Miotto Sep 11 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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