Stack Exchange Network

Stack Exchange network consists of 175 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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [cron]

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

0
votes
1answer
18 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/...
3
votes
1answer
34 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 ...
0
votes
0answers
20 views

Why Drupal use the cron_key?

the cron.php will run drupal_cron_run(); only if there is a valid cron_key GET parameter in the url ex: http://mydomain.fr/cron.php?cron_key=QGlhbwqm8vVuLEE7hFB80lMQxKdOPXxyfGJRr3oAseQ why not just ...
0
votes
1answer
27 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 ...
0
votes
0answers
40 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 ...
0
votes
0answers
20 views

Auto cron runs but doesn't clear the cache

behind the scenes i am accessing a service if (cache) stuff = cached.data else stuff = service.data auto cron is running; however, i notice the auto cron is not purging the cache. I have to go into ...
0
votes
0answers
23 views

Cron processes items via queueworker, how to process after queue is complete

I have a cron job that calls a queueworker to process items. In the cron function, I'd like to perform some more action on the data once the items have been processed. How can I tell that the queue ...
0
votes
1answer
27 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 ...
0
votes
1answer
107 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 ...
2
votes
2answers
31 views

Cannot get subscriptions to send out at correct intervals

I set up the "subscriptions" module and have set it so that all members of the page have access to a number of panels. One allows them to set the frequency of emails, one allows them to pick and ...
0
votes
0answers
29 views

Error: Cron has not run recently. But it did!

I have a site (hosted on Acquia) which always return an error about cron not running on the Status report page, but it actually runs regularly and it does all the task attached to it. Cron is running ...
2
votes
2answers
83 views

Trigger cron internally using PHP

The server my site is on cannot use curl, wget or lynx to call the external cron address (eg http://example.com/cron/cron_key) Is it possible to use php to 'run' the cron from inside the server. I'...
0
votes
1answer
144 views

How can I automate the “Clear Cache” everyday?

Currently we have to clear it manually everyday logging in to admin console and browsing to Home->Administration->Configuration->Development->Performance Is there way we can automate this job in ...
0
votes
0answers
171 views

Jobs falling behind in Ultimate Cron, but none take very long to run

I have a total of 15 cron jobs set up in Ultimate Cron. 14 of them are set to run every 15 minutes, and 15th runs once a week. The longest of the 14 takes 22 seconds to complete. They are only ...
1
vote
2answers
176 views

Ensure that all Cron jobs work correctly

I have a Mobile APP with a Drupal 8 admin backend and I have almost 20 cron jobs running at least 15 times on the day. I'm using Ultimate Cron and Advanced queue modules for handling this. I know that ...
-1
votes
0answers
17 views

Site re-indexing not happening

I am working on a Drupal 6 site. Facing an issue: Site Re-Indexing not working. Even if after running the cron successfully. I have already gone through google search and Drupal forums. Can ...
0
votes
0answers
68 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
33 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
44 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
18 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
123 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 ...
2
votes
1answer
53 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
77 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
37 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 ...
3
votes
2answers
2k 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 ...
2
votes
1answer
387 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
61 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
209 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, ...
2
votes
1answer
155 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
1answer
298 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() ...
1
vote
1answer
2k 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
118 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
90 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
1answer
43 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
162 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
320 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
1answer
219 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 ...
2
votes
3answers
168 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
32 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 ...
1
vote
2answers
44 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
120 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
232 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
66 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
284 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
104 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
59 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
63 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
679 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
452 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
139 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 ...