How to set up cron before Magento 2 update?

You must have 2 cron jobs to update your system. And each must run every minute. 

Why do you need to have Magento cron installed?

You need to have Magento cron installed as Magento crontab is used to run Magento cron jobs. Magento cron tasks can work with different configurations. PHP command-line configuration manages a regular cron job that re-indexes indexers, generates emails, generates a sitemap, etc. 

How to set up Magento 2 crontab?

Follow these steps to set up Magento 2 crontab:

Step 1. Log in as, or switch to, the Magento file system owner.

Step 2. Change to your Magento installation directory.

Step 3. Enter the command:

bin/magento cron:install [--force]

Use --force to rewrite an existing Magento crontab.

magento cron:install does not rewrite an existing crontab inside #~ MAGENTO START and #~ MAGENTO END comments in your crontab.

Magento crontab test view

Magento crontab test view can be done by entering the following command as the Magento file system owner:

crontab -l

Here's an example:

#~ MAGENTO START c5f9e5ed71cceaabc4d4fd9b3e827a2b
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log
#~ MAGENTO END c5f9e5ed71cceaabc4d4fd9b3e827a2b

Working with cron jobs can be easier and more efficient with the Cron Scheduler extension.

Improve the performance of your site with job management, detect cron job errors in time and prevent all possible results that negatively impact Magento. Also, you can easily manage all existing tasks in a single convenient grid.

Here is a list of the extension's features:

  • Visualize and fix errors on the timeline
  • Save work time with improved usability
  • Cron diagnostics
  • Manage all tasks in the Cron Tasks List grid
  • Carry out any tasks outside the schedule
  • Follow the execution process
  • Set a temporary filter for notifications
How can we help you?

Didn’t you find the answer to your question? We are always happy to help you out.