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?
2 Answers
Make sure the crontab is configured
crontab -l
A sample follows:
#~ MAGENTO START
* * * * * /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
#~ MAGENTO END
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
Sep 11, 2019 at 15:21
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
/usr/bin/crontab
Edit:
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? Sep 11, 2019 at 15:19