D
D
Diversia2020-06-22 20:47:38
1C-Bitrix
Diversia, 2020-06-22 20:47:38

Why don't cron agents work?

Hello.

Installed Bitrix virtual appliance version 7.4.3
CentOS Linux release 7.8.2003 (Core)

on a clean server .

Found 1 kernel sites:
------------------------------------------------------------------------------------
SiteName        | dbName          |          Status |  Cron | DocumentRoot
------------------------------------------------------------------------------------
default         | sitemanager     |        finished |     Y | /home/bitrix/www
------------------------------------------------------------------------------------

Agents are not executed. Additionally, I added a task to cron according to the instructions https://dev.1c-bitrix.ru/learning/course/?COURSE_I...

[[email protected] log]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

#* * * * * bitrix test -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php && { /usr/bin/php -d sendmail_path="msmtp -t -i -a default" -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php; } >/dev/null 2>&1

0 2 * * 6 root /opt/webdir/bin/bx-dehydrated
[[email protected] log]# crontab -l -u bitrix
*/1 * * * * /usr/bin/php -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php


Logs:
Jun 22 20:26:01 sss CROND[14213]: (bitrix) CMD (test -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php && { /usr/bin/php -d sendmail_path="msmtp -t -i -a default" -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php; } >/dev/null 2>&1)
Jun 22 20:26:01 sss CROND[14215]: (root) CMD (/opt/webdir/bin/restart_httpd-scale.sh process)
Jun 22 20:26:01 sss CROND[14216]: (bitrix) CMD (/usr/bin/php -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php)
Jun 22 20:26:02 sss CROND[14212]: (bitrix) MAIL (mailed 89 bytes of output but got status 0x0041#012)


dbconn.php
<?
define("BX_USE_MYSQLI", true);
define("DBPersistent", false);
$DBType = "mysql";
$DBHost = "localhost";
$DBLogin = "bitrix0";
$DBPassword = "****";
$DBName = "sitemanager";
$DBDebug = false;
$DBDebugToFile = false;
define("MYSQL_TABLE_TYPE", "INNODB");

define("DELAY_DB_CONNECT", true);
define("CACHED_b_file", 3600);
define("CACHED_b_file_bucket_size", 10);
define("CACHED_b_lang", 3600);
define("CACHED_b_option", 3600);
define("CACHED_b_lang_domain", 3600);
define("CACHED_b_site_template", 3600);
define("CACHED_b_event", 3600);
define("CACHED_b_agent", 3660);
define("CACHED_menu", 3600);

define("BX_UTF", true);
define("BX_FILE_PERMISSIONS", 0644);
define("BX_DIR_PERMISSIONS", 0755);
@umask(~(BX_FILE_PERMISSIONS|BX_DIR_PERMISSIONS)&0777);
define("BX_DISABLE_INDEX_PAGE", true);

if(!(defined("CHK_EVENT") && CHK_EVENT===true))
   define("BX_CRONTAB_SUPPORT", true);
?>


But the agents are not running, check through Settings > Product Settings > Agents. Last run dates are old.
Please tell me how to fix what is the problem?

update

Kron 100% fulfills. The problem is not with him. I tried to add a line with mail() php to /home/bitrix/www/local/php_interface/cron_events.php , a letter on launching from cron came. Something with the execution of periodic agents.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
K
Kalibr, 2020-07-31
@Kalibr

It helped me
added the bitrix user , it helped.
*/1 * * * * bitrix /usr/bin/php -f /home/bitrix/www/bitrix/php_interface/cron_events.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question