Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Use it for questions about performing routine and other maintenance tasks in Drupal.

0
votes
0answers
13 views

How to re-index nodes using search API?

On exploring search_api.module file, there mentioned few hooks.Is there any practical demonstration how to use search_api_index_reindex hook? Basically I'm trying to re-index nodes, after executing ...
1
vote
1answer
23 views

How to run the cron within specified timebound only?

I have a requirement which needs to be done via cron. Some of the jobs should run only in time frame of 9AM-7PM everyday. So how I can schedule a cron for this type of requirements in the crontab.I ...
0
votes
1answer
19 views

Nodes not get indexed after running manual cron

I'm experiencing some unexpected behavior of cron. I have used search_api module, that should index all nodes. Automatic cron is set to 1 hour. So after every hour, cron will run automatically. So, ...
0
votes
0answers
15 views

Inconsistent style for emails sent by rule?

I have a rule configured to fire off an email when the nightly cron tasks runs. So, every 4 a.m. an email gets sent out. If I trigger the rule by running cron manually, the resulting email has the ...
0
votes
0answers
22 views

run drupal console command from linux cron

I have created a .sh file which runs a drupal console command via bash. I have tried to run this script in linux cron and all other commands work with exception to the drupal console command. How ...
1
vote
1answer
39 views

Why is this property of the Cron service initialized in this manner?

I wish someone could help me understand this code statement found on the core cRON service (\Drupal\Core\Cron), especially in the constructor method for this class. public function __construct(...
0
votes
1answer
62 views

How to execute the code at certain time without relying on Cron

I have a custom entity with a timestamp field which can be populated by the user. At these specific "times" I have to "react" and update(execute some code) on some other entities related to this time....
0
votes
1answer
23 views

Ubuntu crontab is not triggering when site is in maintenance mode and also revert to online

I am using the Ultimate cron module and I have set the main Drupal cron task in crontab to run every 5 minutes. I have put my site in maintenance mode. Drupal cron tasks are not running when site is ...
1
vote
2answers
212 views

Cron drupal 8 for my module? [closed]

I am doing a module in drupal 8, I would like to know how to execute a function automatically every month. I think it's done with Cron, but I only get to do it every week. as I edit it from my ...
1
vote
1answer
116 views

How do I set up Search API index as cron task?

From what I've read in Search API's settings, it sounds like pages should be indexing when cron is ran. This doesn't seem to be the case, but perhaps my logic is flawed. I help manage a blog/news ...
0
votes
1answer
34 views

Get Authenticated User ID in Hook Cron?

I have been trying to get the current authenticated user ID in Hook_cron() function. But Its showing only the anonymous user, though the current user is an authenticated user. How Could I get the ...
2
votes
1answer
48 views

What is the relationship between hook_cron() and hook_cron_queue_info()?

Some modules (e.g. Feeds, Rules Scheduler, Revision Scheduler) implement both hook_cron() and hook_cron_queue_info(). When used with Ultimate Cron and the Enable cron queue processing setting enabled, ...
0
votes
0answers
31 views

Is it possible to granularly update XML Sitemap?

I want to be able to update XML Sitemaps granularly i.e. only the links that are new should be added & those that are old/invalid should be removed. The entire sitemap shouldn't be regenerated/...
1
vote
1answer
61 views

Cron Queue API - Exception in worker callback prevents queue item from being removed

I have created a Drupal 7 module that utilizes hook_cron() and hook_cron_queue_info() to process some data, as well as use the module Ultimate Cron to handle scheduling when each runs. hook_cron() is ...
0
votes
0answers
30 views

Run queue_feeds_source_import Programmatically

I created a custom cron job via Elysica cron module. Now, what I wanted to do after running this cucstom cron job, is to run next the queue_feeds_source_import. I manage to override the rule settings ...
0
votes
1answer
106 views

Running a Script with Job Scheduler API

I am trying to use the Job Scheduler Module's API to automatically run a script every 6 hours but I'm having problems getting it working. This is the code: function jobbank_cron_job_scheduler_info() ...
0
votes
1answer
458 views

How to implement a cron job for every minute and every 5 minutes?

In D8 I programmed hook_cron. I tested it several times but I cannot see any log in the watchlog. The name of the module is nncbt. The code is placed in nncbt.module. Any suggestions what I should ...
0
votes
0answers
12 views

How Do I Do a Thing According to a Date Field From the Users Programmatically?

I'm using Drupal 8 and every user has a date field, let's call this field as b_field, and let's say this is a field for user to fill their birthday and I would like to send an email in advance x day ...
0
votes
0answers
51 views

Running a PHP script with Elysia CRON

I want to automatically run a PHP script every 3 hours or so. The script is pretty heavy. It pulls XML data from another website then encodes it into a JSON file to be imported by feeds. The ...
0
votes
0answers
50 views

How to add event in cron queue by event subscribe in drupal 8?

I have to add an event in cron query. what I am trying to do is to create an event as the order is confirmed and placed that event in the query. so as the cron run email will be sent.Also, i have put ...
0
votes
0answers
29 views

callback_allowed_values crashes cron

I am using the following callback_allowed_values function: function hnbuilder_fheq_allowed_values(FieldStorageConfig $definition, ContentEntityInterface $entity = NULL, $cacheable){ if ($_GET['id'...
0
votes
1answer
31 views

Why running cron tasks would hit a REST service endpoint?

I can't run cron jobs from a single module or from core anymore. Somehow Drush hits a REST service endpoint. I have configured some service endpoints for views, but why would cron jobs hit that? I ...
0
votes
0answers
64 views

Why is the cache bin garbage collection in system_cron() so slow?

Cron runs seem to take longer and longer every day for this Drupal 8 site. Pretty much all of the installed modules with cron hooks seem to behave (runs rarely take longer than a couple of seconds). ...
-1
votes
1answer
192 views

How to run custom .php file after click run cron button?

I have create one custom_cron.php file in root director. But I want to run file after click on Run cron button from admin site.
0
votes
0answers
40 views

How to replace the following drush command from cron?

I'm implementing a rss import with the help of migrate tools. In one of this steps there is the following line: 3) Add a line to your system cron to run drush migrate -y my_rss_importer at whatever ...
0
votes
1answer
107 views

Why does cron run as an anonymous user?

I ran into an issue recently where my hook_cron function was failing when triggered by cron. The problem was that I was calling EntityFieldQuery, which does access checks and since cron runs as an ...
0
votes
0answers
27 views

wd-show for multiple types

Im pretty new to Drupal (8.3.7). Im trying to list actions logged on my Drupal Database by certain types. On terminal, I know I run wd-show --type= But how can I do it if I want to list for user, ...
2
votes
3answers
94 views

How to use cron to delete nodes of a content type that does not allow deletion by anonymous users

The background for this question is here: Delete nodes using Rules and VBO Summary: a VBO View selects various nodes of a particular content type. A Rules Action Set is instructed to load this VBO ...
0
votes
1answer
22 views

Foolproof way to prevent email sends from local/dev server

We have had a number of occasions when a new new developer starts working on a project, and when they have it installed the cron runs and sends out a load of emails to users. If the database is fairly ...
0
votes
0answers
43 views

Ultimate cron multi thread

I have installed the 'Ultimate Cron' module these days. After setting everything up, I wanted to divide the various Drupal's corn from my personal modules (example_cron and test_cron), but I'm not ...
1
vote
2answers
35 views

Rules component works different when fired by cron

I have a Rules Component that I want to run every week, using cron. The component's elements: set a variable (emailbodytext) viewsloop 1 to fill the emailbodytext with titles of all recent nodes ...
1
vote
0answers
67 views

Cron job in custom module not appearing in Cron Settings (using Elysia Cron)

Very strange problem that I cannot find anyone else having. I have a custom module and am using hook_cron(), but the cron job is not appearing in /admin/config/system/cron of my Drupal 7 site. All ...
0
votes
1answer
94 views

images missing - wrong base url

My website occasionally loses images due to the image url being set to http://default/sites/files/XXXX.jpg. The "default" baseurl is the issue and as i understand drupal 8 has no way of setting this ...
0
votes
1answer
45 views

Nightly truncating all cache_* tables? Good or bad?

I'm having some issues on various D7 sites with some cache tables growing stupidly large (e.g cache_metadata or cache_menu) which then makes drush cc all very slow (more than 1 minute). Do you think ...
0
votes
2answers
158 views

Send daily automated mails to specific roles programmatically

I'm working on a D8 project and I want to send every day an automated mail to all users with a specific role, lets say 'custom admin'. The mail should contain the results of a database query. Rules ...
0
votes
1answer
60 views

Cron tasks don't work: Could the Domain Access module be the cause?

I have an issue with a website running Drupal 8. I cannot seem to get cron working. If I go to the status page and click 'run now' it works. If I try to open the cron settings (/admin/config/system/...
2
votes
1answer
32 views

Scheduled rules execute a hour after they are supposed to

I have created a scheduled rule that sends a email based on a date field in nodes of a certain content type. The rule executes as scheduled and the email is sent but for some reason it only fires ...
0
votes
1answer
55 views

How to encrypt drush backups with gnupg

I am trying to set up a cron job that automatically backups up a Drupal site using drush but then encrypts that file. I would like to accomplish this using a single command but am not sure how to go ...
0
votes
1answer
318 views

How to define multiple cronjobs within single module?

What would be a good way to define two (or more) cronjobs without creating multiple modules? As far as I know, in order to define a new cronjob, a hook_cron needs to be used like following: function ...
-1
votes
2answers
179 views

Change user role programmatically using cron according to Webservice

On my site I want to set cron job that will check if user already submited form that allow them to browse website freely. I tried to catch user id (and assign a new role id) in \core\lib\Drupal\Core\...
0
votes
1answer
72 views

sql-dump failing when run as cron

I have a shell script that executes drush sql-dump, compresses the result and then sends it to a backup server. It works fine when run from the command line as root but it is failing silently and ...
0
votes
1answer
35 views

Drupal Elysia Cron Max execution time error, in select.inc

PHP Fatal error: Maximum execution time of 120 seconds exceeded in /var/www/domainname.com/public/includes/database/select.inc on line 1309 I have an elysia cron command that takes perhaps 10-15 ...
3
votes
1answer
60 views

How to send a mail to a user with views rules when a date is passed?

I have created a date field for all users (in Drupal 7). This date is the end of the user's subscription. When the date of this field is passed, I want to send a mail to the user to tell him he can ...
0
votes
2answers
795 views

Get cron to process QueueWorker items at a specific time

I have a Plugin\QueueWorker that creates a queue of emails to send from nodes that are created/updated throughout the day. I've defined a processItem() method, as well as an arbitrary function (let's ...
-1
votes
1answer
71 views

Why do cron.php still run automatically in each o'clock when I had stopped it?

I am curious on this. I had switch off it on my setting->system->cron to permanently stop it. However, the mail will hourly send the mail to www-data. The mail content as below: curl: (22) The ...
0
votes
1answer
123 views

How to execute hook_cron after a rule with event Cron maintenance tasks are performed?

I have a rule with event Cron maintenance tasks are performed. It is executed when a cron run. I have implemented hook_cron in my custom module and I want this hook_cron should be run after that ...
1
vote
1answer
41 views

How to force cron to use config saved during a SimpleTest?

I write a test using Drupal\simpletest\WebTestBase for a custom module, which implements hook_cron(). The test saves a configuration object, which should be used by the cron, and then runs the cron: ...
2
votes
1answer
286 views

Need to run cron as authenticated user

Hi on my server I need to be running cron as an authenticated user in order for the directories that I need to access during a specific function to be writable. How can I make cron or at least part ...
0
votes
1answer
320 views

Can I write two cron( hook_cron() ) in one module

I have a custom module abc_xyz and i want to write two seperate cron for this module. below is the code which i am trying but it is creating only one cron , with name abc_xyz_cron. it is not ...
1
vote
1answer
47 views

Cron removes dblog watchdog

I set the cron to run every day. I want to prevent the cron from deleting some of the watchdog table content. But i didn't find a way to do it, i still want the cron to run for the search index. ...