cancel
Showing results for 
Search instead for 
Did you mean: 

Schedule Backup not working

SOLVED

Re: Schedule Backup not working

@gelanivishal 

Sorry for the late replay but I was running some tests on cronjobs.

 

It looks like Cronjob is working, in fact in the table `cron_schedule` I can see that there are some jobs scheduled and some which were executed fine http://prntscr.com/midbmq

That's why I got lost in this problem since I already checked with my hosting company, and they assured me that the cron job is working fine, in fact, I also receive an email every time a cronjob is run.

That's what it is troubling me that some jobs are working while others are not.

 

And I still can't figure out what is happening and why backups are not being scheduled.

Re: Schedule Backup not working

Hello @robertbits ,

 

Please go to Cron Job Schedule List menu of extension and check message column those are pending or incomplete. You will get root cause of your issue. 

 

Also, give me screenshot of cronjob configuration.

 

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

Re: Schedule Backup not working

Hi @gelanivishal 

 

In this link, you can see some of the Cron Jobs (http://prntscr.com/mk0cv5), among them, is the system_backup, which is enabled.

 

In the cron job schedule list, there are only 2 success and the rest are pending, but nothing in the message column (http://prntscr.com/mk0fjv). 

 

also note that at the top under the title I have the error No cron execution found. which I don't know what it means.

 

this is a screenshot of the cron configuration on my hosting (http://prntscr.com/mk0iky)

Re: Schedule Backup not working

Hello @robertbits ,

 

There is look like cron is not configured on server as well so we got this type issue, Please configure as below and let me know.

 

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: Schedule Backup not working

@gelanivishal 

when in SSH I tried to run this command: crontab -u magento_user -e

i got this error: -bash: crontab: command not found

I got the same error when I run crontab -l, which from I read it should give me a list of active cronjobs.

is this command crontab a function of magento 2.2 and how it works?

 

Re: Schedule Backup not working

It looks like the problem has been solved. The last thing that I have done was changed some settings from Stores > Configuration > Advanced > System > Cron (Scheduled Tasks)

 

the settings where:

  • Generate Schedules Every: 15
  • Schedule Ahead for: 10
  • Missed if not run within:15 
  • History cleanup every: 10
  • Success history lifetime: 10080
  • Failure history lifetime: 10080
  • use separate process: No

and I have changed:

  • Schedule Ahead for: 20
  • Missed if not run within: 65 
  • History cleanup every: 120

now the backup is being created fine and other cron jobs are running.

 

I'd like to thank you @gelanivishal  very much for your help with this problem since I really was confused about what was causing the problem.