cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Cron job on Google Cloud help

SOLVED

Magento 2 Cron job on Google Cloud help

I just deployed Magento on Google Cloud platform and then getting the error.

I search the web how I can confirm cron job on Google Cloud but I was not successful.

please any help this the message I get

System messages

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 Cron job on Google Cloud help

@osha_zarad1Are you able to connect to your Google Cloud server using SSH or do you have a CPanel for the same? Command explained above by @gelanivishal can be used on SSH command prompt to configure the crons.

 

You can make SSH connection using Putty software.

 

Let know if this help otherwise please provide more details on where you have the issue to provide more appropriate answer.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

View solution in original post

11 REPLIES 11

Re: Magento 2 Cron job on Google Cloud help

Hello @osha_zarad1 ,

 

To setup cronjob on server, Please follow below steps

Please log in on the server by the terminal

 

Find the PHP binary and php.ini path
To display the path to your PHP binary, enter

 

$ which php

A sample result follows:

 

 

/usr/bin/php

 

Create the cron job
To create a cron job for the Magento file system owner, enter the following command as a user with root privileges:

 

$ crontab -u <Magento file system owner username> -e

For example,

 

 

$ crontab -u magento_user -e

A text editor displays. (You might need to choose a text editor first.)

 

 

* * * * * &lt;path to php binary> &lt;magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> &lt;magento install dir>/var/log/magento.cron.log
* * * * * &lt;path to php binary> &lt;magento install dir>/update/cron.php >> &lt;magento install dir>/var/log/update.cron.log
* * * * * &lt;path to php binary> &lt;magento install dir>/bin/magento setup:cron:run >> &lt;magento install dir>/var/log/setup.cron.log

where

 

  • <path to php binary> is the absolute file system path to your PHP binary
  • <magento install dir> is the directory in which you installed the Magento software; for example, /var/www
  • | grep -v "Ran jobs by schedule" filters this message from the log, making any errors easier to spot

The first command (magento cron:run) reindexes indexers, sends automated e-mails, generates the sitemap, and so on. Usually, it’s associated with the PHP command line .ini file. The other two commands are used by the Component Manager and System Upgrade

 

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Magento 2 Cron job on Google Cloud help

Thank you for your prompt reply.

are you able to show me how to do that on Google Cloud?

Re: Magento 2 Cron job on Google Cloud help

@osha_zarad1Are you able to connect to your Google Cloud server using SSH or do you have a CPanel for the same? Command explained above by @gelanivishal can be used on SSH command prompt to configure the crons.

 

You can make SSH connection using Putty software.

 

Let know if this help otherwise please provide more details on where you have the issue to provide more appropriate answer.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Magento 2 Cron job on Google Cloud help

I believed this how we do cron job on Google Cloud.please see attachmentScreenshot 2019-02-12 at 3.29.24 PM.png

thank yoScreenshot 2019-02-12 at 3.35.38 PM.pngScreenshot 2019-02-12 at 3.29.24 PM.png

Re: Magento 2 Cron job on Google Cloud help

By default, a new Google Compute Engine (GCE) VM instance does not have SSH keys 

Re: Magento 2 Cron job on Google Cloud help

we use ssh keys with our Compute Engine instances all the time.

and the easiest way is to use SSH icon to open SSH console, "sudo su" to login as root to the server and after su as a user to modify crontab and add new cronjobs.

or just get somebody who knows what they are doing to manage your server.

 

Anton Pachkine @ magento2.hosting : Magento Small Business Package.

Re: Magento 2 Cron job on Google Cloud help

Re: Magento 2 Cron job on Google Cloud help

By default, a new Google Compute Engine (GCE) VM instance does not have SSH keys 

best article on internet