Magento 2.x – How to run a cronjob process by its code

If you need to run just a cron process per its code, the fastest way is using n98-magerun2 tool,  if you are not familiar with, this is a command line suite of tools that make development easier.

You can install it with those basic steps:

Once n98-magerun2 is installed properly, you will be able to run your cronjob as follows in yuor magento root directory:


For more information about n98-magerun2 you can review this link