Questions tagged [cron]

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

Filter by
Sorted by
Tagged with
-1
votes
1answer
455 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
353 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
235 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
37 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
49 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
169 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
387 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
83 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
545 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
181 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
71 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
75 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
948 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
621 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\...
1
vote
1answer
184 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
71 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
103 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 ...
4
votes
2answers
2k 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
118 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
182 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
83 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
704 views

Need to run cron as authenticated user [closed]

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
918 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 ...
0
votes
1answer
125 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. ...
1
vote
2answers
343 views

It doesn't run the first time

Trying to run cron tasks using 0 */1 * * * root curl -s http://site.name/cron.php?cron_key=secret_key >> /var/log/site-cron.log 2>&1 or 0 */1 * * * root wget -O - -q -t 1 http://site.name/...
0
votes
1answer
94 views

Cron task does not create images

I've made a module which will parse a few RSS feeds, and automatically creates new content. But I've got an issue creating images. Since D7, cron are run anonymously, so I think my problem comes from ...
0
votes
1answer
53 views

Why we need hook_cron if the cron job requires a path?

In drupal we have a hook_cron() which runs on cron. But in cron job we have to specify a path, the cron will access that path and will run the code in the page callback function of that path. So my ...
0
votes
1answer
199 views

Ultimate Cron. Invoke a cron from a cron. Set a cron enabled status to TRUE till its queue gets empty. Then set it to FALSE

I am using Ultimate Cron for running individual cron runs and I see Ultimate Cron provide hook_cronapi() to create own cron task runs and provide enabled key as either TRUE or FALSE. My objective is ...
4
votes
1answer
4k views

How to clear form cache automatically?

I am working on a Drupal 7 site. When I check the cache_form table it reaches 4 GB daily so I have to manually truncate the cache_form table. Is there any way to clear cache_form table automatically ...
0
votes
0answers
58 views

Programmatically rearrange blocks in region and save in database?

Need to react on site events and regroup blocks in front. I have my region 'Top' in front, configuration is like this: Block2: India News Block1: World News Block3: Frontpage content When new ...
0
votes
1answer
319 views

Scheduler Module crontab job does not publish content

When running the Scheduler lightweight cron through crontab, I am getting a message that the lightweight cron has activated and completed in my D8 log, but content is not publishing. When running the ...
2
votes
1answer
355 views

Memory size exhausted when trying to run Cron manually

On my Drupal 6 website, when I run cron manually the following error message shows up: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4181580 bytes) in /dirname/...
4
votes
2answers
658 views

Delete directory from private folder programatically?

I'm using D8, and am writing a cron task to remove old backups from my private files directory. The backups are generated in private://db_backups/date-of-backups/backup.gz. The following code is ...
4
votes
3answers
661 views

Debug arrays from hook_cron?

Does anybody know of the proper way to debug objects from within hook_cron? I'm trying to set up a task that periodically deletes backups from my private folder, but I can't properly debug arrays that ...
4
votes
2answers
4k views

How can execute batch api over cron jobs

I am working on Drupal 8 and batch API. I created the batch api calling importingmatch and it should automatically importing every 1 hour. My solution is use Drush for make it works without the ...
0
votes
1answer
1k views

Where do I place hook_cron()?

I think I need to use hook_cron() to cause my new module to be run each time cron runs, but in what file and directory do I place this code? Is it in my new module or some other place. Logically, it ...
0
votes
1answer
113 views

How to run cron automatically after node published?

cron has to run after some time of node publishing.I tried like this function custom_module_cron{ //($updated = node published time) if(date("Y/m/d H:i:s") == date("Y/m/d H:i:s",$updated+60)){ //...
2
votes
2answers
345 views

Cron issue with Drush 8

My Drupal 6 sites are hosted on a Linux server with Apache 2.2, PHP 5.5, MySQL 5.6 installed. I use Drush 8 which I installed via composer. I set a cron job via cPanel which runs every day this ...
2
votes
3answers
524 views

Execute system cron manually

How to execute system cron manually via drush or drupal UI?
0
votes
1answer
14 views

What services must I leave switched on in Elysia cron

I have installed Elysia Cron to import some Feeds data periodically. However, I have switched off all the other cron tabs that I have in order not to interfere. However, my database size grows to ten ...
0
votes
1answer
249 views

Elysia cron and feeds being stuck - how to resume the imports?

I have a bunch of Feeds imports, programmed automatically with Elysia Cron. There is a problem with the size of the content to be loaded, as the import uses to hang, and always at about the same ...
0
votes
2answers
564 views

Can we automate scheduled published/Unpublished nodes in drupal 8?

Schedular Module helps to schedule Nodes publish and un-published in Drupal 8. But it affect took place on each cron run only. For example. If I set Publish a Node A on 19/10/16 14:30 but site ...
1
vote
1answer
319 views

Drupal 7 node body content missing from search results

I am having an issue where my Drupal 7 Search (Custom search installed and enabled) isn't returning all of the results I'd expect it to. Here is some background... I'm running Drupal 7 on this site....
0
votes
1answer
85 views

How to prevent that import with Feeds and Elysia cron gets stuck

I have several Feeds which are called by Elysia cron. The feeds are called at a given time, and later the last two feeds are called each 2 minutes, because it was the only way of preventing them from ...
0
votes
1answer
461 views

how to run cron hook after a week [duplicate]

i have created a module to hook Drupal cron system and the function in my module is being executed on every cron run, which is perfect. I need this hooked cron function to run only once weekly ...
1
vote
1answer
304 views

How to force a cron run after a Rules component is scheduled?

This question is a sequel on Why is the database not updated before a next Rule is launched?. I have a Rule that schedules a Rules component 5 seconds after the current time (this number is ...
0
votes
1answer
757 views

How to manage by cron a long-running queue of very many items

I'm creating a File Checker module that verifies files managed by Drupal actually exist at the uri where Drupal believes they are. It places an item in a queue for each file entity. As there could be ...
1
vote
1answer
395 views

Downloading, and loading Google analytics script locally and daily with Drupal Cron

I'm using Drupal Google Analytics module for some time; It works perfectly and gives me the data I need. Yet, since instilling it, I get the following notification on Google Pagespeed Insights: Do ...
0
votes
1answer
476 views

Scheduler Module unpublish content

Trying to schedule a content type to be unpublished on a specific date. Using the scheduler module everything is set up seemingly correct. When I run Cron the update fails, Updater Content - ...
1
vote
3answers
3k views

How to check if an item exists in a Queue?

While inserting items in a Queue how can I check if the item I am trying to insert is already present in the Queue?

1
2
3 4 5
9