Questions tagged [cron]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
50 views

hook_cron(): PHP output does not appear

I am (finally) migrating our Drupal 7 sites to Drupal 10. The one problem I have not been able to resolve is output from the hook_cron(). Everything appears to execute, whether running on the browser ...
backtothefuture's user avatar
0 votes
0 answers
22 views

ECA: Cron Event - View - Message per Mail

ECA: Cron Event - View - Message per Mail I would like to send a notification by e-mail to a user when a certain event occurs. The event is then a view that outputs a content, this content is ...
Bavramor's user avatar
-2 votes
1 answer
70 views

How to execute code that uses the dependency injection container, at regular intervals?

Using Drupal 10 - I tried installing Ultimate Cron for D10, but it is in Alpha state and has deprecated methods that will not let it work. This Cron needs to be executed only on a specific day and ...
Cy Jobes's user avatar
2 votes
1 answer
181 views

getPluginDefinition custom QueueWorker empty after upgrade

I've got a custom queue worker that used to work fine in Drupal 9, but stopped working after the upgrade to Drupal 10. I've narrowed it down to the getPluginDefinition method not returning anything. ...
Menno van den Heuvel's user avatar
1 vote
0 answers
60 views

Advanced queue module: How to stop processing queue in cron, when some conditions apply in job event/job preprocessing?

I have a custom module handling jobs from the Advanced Queue module. To limit the number of jobs allowed to be processed in one cron run, I have some configuration variables in my custom module. With ...
dercheffe's user avatar
  • 151
2 votes
1 answer
78 views

When does system_requirements function runs?

When does Drupal call system_requirements(), which hardens permissions for files and for directories containing them? Does Drupal call it in each cron run?
tahaniau's user avatar
0 votes
1 answer
166 views

Error: on cron (field_purge_batch)

Seems that Drupal got issues removing deleted fields on cron (just a theory). Got the following error message after cron ran. Anybody got an idea how to get rid of it? Warning: foreach() argument must ...
mogio's user avatar
  • 687
0 votes
1 answer
974 views

How to stop cron process without rebooting my server?

I have tried the following: drush php-eval "\Drupal::lock()->release('cron');" This had no effect. I'm still seeing "Attempting to re-run cron" errors pile up in the log. I ...
arnoldbird's user avatar
  • 1,203
1 vote
0 answers
299 views

How to execute migration in queue through cron run?

I am migrating some nodes from an API. The API only accepts 60 requests per minute. So it means if 60 items are imported in a minute, all other items will not be imported because the API will return ...
Ahmad's user avatar
  • 2,835
0 votes
0 answers
107 views

hook_cron triggered manually but not automatically

That hook cron below is executed when i manually trigger the cron but is not on a regular automatic base (every 3h). How can it be ? function my_module_cron() { \Drupal::logger('my_module')->...
Matoeil's user avatar
  • 3,429
0 votes
0 answers
84 views

Cron is running but not saving entity

I am trying to create a simple hook_cron to connect with an external API, return some data and update some fields in some entities. I'm creating like this to understand better how cron works, so I ...
Jean da Silva's user avatar
1 vote
1 answer
158 views

How many temporary files will be deleted on every cron run?

I was just wondering if anyone knew how many files the Drupal cron removes from your tmp/ directory per cron run? Is it limited to 100 at a time? Where can I see this information?
Nitro's user avatar
  • 60
2 votes
1 answer
758 views

Cron Tasks not running in background, causing pages to take forever to load

We recently upgraded to D8 and I have been experiencing weird issues with Cron. Specifically, whenever the Cron is running, web pages are taking forever to load because cron is running some JS on the ...
BlondeSwan's user avatar
-1 votes
2 answers
2k views

Change system file temporary maximum age

The default setting given to delete temp files is after 6 hours minimum. I have users upload files and I want that if it has temp status, delete it after 15 secs. Tweaking the file module code is ...
Pankhuri Singh's user avatar
0 votes
0 answers
172 views

How can I completely disable cron so that it won't run even if the cron URL is hit or cron is ran manually?

When working on a dev site I'd like to put in a safeguard to make sure cron cannot run, even if triggered manually. Is there a way to do this in Drupal 7?
quantumized's user avatar
  • 1,227
-1 votes
1 answer
224 views

Why is my custom webform handler, when called via cron, doesn't load and email attachments?

I created a custom webform handler that on postSave adds webform id to the queue: public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) { $item = array( '...
Margarita's user avatar
1 vote
3 answers
1k views

How to set up a cron job that runs for a specific rule?

I have a 2 rules that should run each on a specific time interval instead of the regular cron job setting. I have a list of "Sessions" (entity type) that should be evaluated to see if their ...
BassPlaya's user avatar
  • 338
2 votes
0 answers
1k views

How can I have a single QueueWorker run on cron for multiple Queues?

I have a site in which I associate multiple Config Entities with a single Queue ie. example_queue (using the default QueueInterface). My Config Entities produce records that are processed as queue ...
baikho's user avatar
  • 1,739
0 votes
1 answer
363 views

Is there a token for the cron token?

For internal use by editors I would like to get cron link into a custom menu, but I need to do this dynamically, such that it can used across multiple sites. Editors do not have access to Admin ...
MrPaulDriver's user avatar
  • 1,027
0 votes
1 answer
670 views

Ultimate Cron installation Table 'db_name.ultimate_cron_log' doesn't exist

After installing the ultimate cron module version 8.x-2.0-alpha4, When I navigate to (/admin/config/system/cron/jobs), I get the following error meassage - Base table or view not found: 1146 Table '...
Apoorva Jain's user avatar
2 votes
3 answers
426 views

What is the mechanism behind class comments?

* @QueueWorker( * id = "my_module_image_style", * title = @Translation("Generate image styles"), * cron = {"time" = 60} * ) And more specifically what is the effect of cron = {"time" = ...
Matoeil's user avatar
  • 3,429
0 votes
0 answers
814 views

Running cron every minute on Pantheon with Elysia Cron

I am on pantheon now and I've never used a cloud host before so I'm used to being able to set cron on the server. This is totally new territory for me. I have some tasks that I need to run every ...
otherpoint's user avatar
0 votes
1 answer
263 views

Feeds Importer and cron not running

I have a Drupal 7 setup with a number of different content types, each with a common set of fields. Each content type has its own feed, which calls a .csv that's produced from a Google Spreadsheet ...
Steve's user avatar
  • 1
0 votes
1 answer
1k views

Cron error: LogicException : Render context is empty

In a custom module (sel), I have this code: function sel_cron() { $accountSwitcher = Drupal::service('account_switcher'); $account = \Drupal\user\Entity\User::load(1); $accountSwitcher->...
gbmapo's user avatar
  • 1,066
1 vote
1 answer
313 views

How to confirm that drush-based cron is being called from crontab?

I don’t know whether this is a docksal-specific question or a general cron one, but likely the latter. I’ve set up a crontab for docksal (see https://blog.docksal.io/running-scheduled-events-with-...
beltouche's user avatar
  • 719
3 votes
2 answers
118 views

How to override core history_cron

I want to display the reading history of nodes using Views. For this reason there is a history module in core, but the history_cron hook deletes history older than 1 month. I want to override this ...
pimstak's user avatar
  • 45
0 votes
1 answer
492 views

Change the value of a taxonomy field on cron run

I have the article node with two extra fields: Taxonomy reference field field_verification_status with two possible values: Valid (tid: 272) Expired (tid: 271) Date field (field_article_expiry_date)...
user avatar
0 votes
1 answer
3k views

Create a cron job to automatically clear cache

I'm trying to clear cache automatically with a cron job but it didn't work. I'm debugging simply on the browser at this link website-url/cronjob.php. I think it's a problem with the syntax, I have ...
Roland Iordache's user avatar
0 votes
1 answer
845 views

Set up a cron job to run drush migrate command

I have a custom module which migrates articles from a remote xml file. Because the RSS feed changes, I want my Drupal site to be in sync with the RSS feed. How do add e.g this command drush mim ...
meez's user avatar
  • 1,333
-3 votes
1 answer
2k views

How to include or hit a php file from custom module in Drupal 8

I am working on a custom Drupal 8 module. I have a seperate php script as a .php file. I want to include that file in my Drupal 8 module, in simple words I want to hit that .php file by running my ...
Eshban's user avatar
  • 25
0 votes
1 answer
207 views

How to re-publish nodes after unpublishing with hook_cron?

Good morning, I'm running some tests with hook_cron in Drupal 8. My goal is to unpublish nodes of a specific content type ('event'), and once I enabled my module, I was able to accomplish this. ...
yogurtexpress's user avatar
0 votes
2 answers
642 views

Cron error message. table or view not found: 1146

In watchdog I am seeing an error when cron is run. Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tdtvnksvps.field_deleted_data_38d3088921'...
MrPaulDriver's user avatar
  • 1,027
2 votes
0 answers
177 views

How to schedule content every Wednesday at 18.00 (6 PM)?

Looking for something which was easy in Drupal 7, but can't find it or can't get it to work in Drupal 8. import feed do not publish content immediately run a rule that sets the content to publish ...
mchvdm's user avatar
  • 23
0 votes
1 answer
1k views

Cron timeouts at 60 seconds, but all the related timeouts are set higher

We're getting 504 Gateway Timeouts on AWS from a Drupal 7 site at 60 seconds, but everything AFAIK is greater than that. The timeout is specifically during running the feeds_source_import in Ultimate ...
Aaron Chamberlain's user avatar
1 vote
1 answer
514 views

Error while set a paragraph field to NULL during cron run

I am using Drupal 8 and I have implemented a hook_cron to set a node field to NULL. Here is my code: if ($lesson->field_lesson_ended_at->value < $current_time && $session_id &&...
Asatur Vardanyan's user avatar
1 vote
1 answer
462 views

Job queue – dealing with stuck records

I have a cron job that gets stuck because I have a loop claiming items from the queue that ends on numberOfItems() == 0, which never happens because one of the queue items is stuck and cannot be ...
Ynhockey's user avatar
  • 430
0 votes
0 answers
699 views

How To Get Item_id value in ProcessItem function

I developed a custom module which will process my items in queue. I have some custom table and custom action buttons to Process queue items. When i click on "Process Queue" button it will call the ...
user3463733's user avatar
1 vote
1 answer
665 views

Exporting a View CSV during Cron

I'm working on a drupal 7 site and my client would like to have a certain view export as a CSV once a day into a folder. My initial thought was to tie this functionality to our cron schedule, but I'm ...
dwinste's user avatar
  • 11
0 votes
1 answer
662 views

Is it possible to invoke cron within a hook or route class?

I'm using the Deploy suite, which requires cron to be run after a deployment is created. However, when I try to execute \Drupal\Core\Cron::run(); from hook_entity_create() or from a route Class, it ...
Mrweiner's user avatar
  • 1,921
0 votes
2 answers
486 views

Using Ultimate cron to set a specific time to run a function of module, but it is not working as expected

I have set ultimate cron job time once a day but it works at every hour because another default site cron is running every hour. This code is working on production but not according to crontab time i....
user96382's user avatar
-1 votes
2 answers
1k views

How can I delete a file in a cron job?

A custom module is creating a file in public:// folder, that should reside there only temporary. How can I delete this temporary file in a cron job?
Rahulmon Johnson's user avatar
0 votes
0 answers
91 views

Why are image styles only being generated during a cron run?

I've got a weird thing going where image styles are not being generated after uploading images (as media entities) Image styles are generated during a cron run. Is there a setting for this that I ...
MrPaulDriver's user avatar
  • 1,027
10 votes
3 answers
24k views

Programmatically get the results of a view

Using the group module in D8, I have the below view with machine name: group_members_per_group Machine Name of: (Member account) User: Full Name is: field_user_full_name (Member account) User: ...
user avatar
0 votes
0 answers
151 views

Weekly Drupal cron task exiting unexpectedly, Drupal not reporting error

I have my doubts that this problem is actually caused by my Drupal configuration, but am wondering if anyone else has experienced a similar issue and how they went (or would go about) troubleshooting ...
saramm1's user avatar
  • 727
0 votes
1 answer
2k views

Drush command to run cron won't work in Crontab

I am attempting to run two Drush commands from my crontab: # m h dom mon dow command */2 * * * * drush -r /path -l https://www.domain.com/ cron */2 * * * * drush -r /path -l https://www.domain.com/...
Rob Fyffe's user avatar
  • 121
4 votes
2 answers
619 views

Finding nodes that have not been indexed

On a Drupal 8 website I'm administering the ratio of paged indexed by search_cron stays at a value far below 100%. New pages are indexed, but it looks as if updated pages are not indexed again. I ...
RHa's user avatar
  • 143
0 votes
1 answer
42 views

Drupal website goes offline every 2 days for 15 minutes

We provide hosting services (Dedicated Server) to a client whose website is based on drupal. This month, his website goes offline for 15 minutes every 2 days. We already have monitoring tools (i.e ...
SmootQ's user avatar
  • 103
0 votes
0 answers
138 views

drupal_http_request as authenticated user during cron

I have a rule set up that runs during cron. Part of that rule is an action that is supposed to save a PDF (via Entity Print which only authenticated users can access) to my server. It works fine when ...
MrPeanut's user avatar
  • 383
0 votes
1 answer
79 views

module to test if e-mail is working

In D7 I'm trying to determine the best way to periodically check if e-mail is working. I'm looking for a way to create a workflow that, say, on cron would check the day of the month, if it's the day ...
Pat Leonard's user avatar
1 vote
2 answers
5k views

Schedule cron jobs using Ultimate Cron

In one of my modules I would like to create two different cron jobs to handle two different procedures. What I did was to use the Ultimate Cron module, and by implementing the cron api, to schedule ...
Marko Polo's user avatar

1
2 3 4 5
10