What Is a Cron?
A cron is a daemon (a background process) that runs on Unix-like operating systems. It is used to schedule tasks, called cron jobs to be executed automatically at a specified time or interval.
What Is a Cron Job?
Cron jobs are computerized responsibilities which are performed on a predefined timetable. they may be generally used for things like strolling backups, sending emails, and appearing for device maintenance obligations. Cron jobs are beneficial for automating repetitive responsibilities and emerging duties that want to be run on a schedule.
Create the Magento crontab
To create the Magento crontab:
- Log in as, or switch to, the file system owner.
- Change to your Magento installation directory.
- Enter the following command.
bin/magento cron:install [--force]
To view the crontab, enter the following command as the file system owner:
crontab -l
Remove the crontab
To remove the Commerce crontab:
- Log in as or switch to the file system owner.
- Change to the Commerce installation directory.
- Enter the following command:
bin/magento cron:remove
Run cron job
bin/magento cron:run [--group="<cron group name>"]
where --group
specifies the cron group to run (omit this option to run cron for all groups)
All cron data is also written to the cron_schedule
the table in the Magento database. The table provides a history of cron jobs.
You can learn more about cron in this post: http://webkul.com/blog/magento2-setup-cron-config-path/
Be the first to comment.