N
N
Nikolai Kislukhin2016-03-30 07:04:58
PHP
Nikolai Kislukhin, 2016-03-30 07:04:58

How to put Bitrix script on cron?

How to put a Bitrix script on cron? Namely, I want the sitemap generation to run every day at 11 am. Now in the /etc/crontab file I wrote:

00 11 * * *  bitrix test -f /home/bitrix/www/bitrix/modules/seo/admin/sitemap_cron.php && { /usr/bin/php -f /home/bitrix/www/bitrix/modules/seo/admin/sitemap_cron.php ; } >/dev/null 2>&1

and copied the file seo_sitemap_run.php to sitemap_cron.php and added in the file:
#!/usr/bin/php

$_SERVER["DOCUMENT_ROOT"] = "/home/bitrix/www";
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];

define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules­/main/include/prolog_before.php");
set_time_limit(0);

But nothing happens.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2016-03-30
@rpsv

https://dev.1c-bitrix.ru/learning/course/?COURSE_I...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question