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?

  • Are you asking about files being deleted from the /tmp directory on your server? or temporary Drupal file entities (i.e. from /admin/content/files?status=0)?
    – sonfd
    Commented Jun 24, 2021 at 23:08

1 Answer 1


Yes, the query is set to 100 items per cron run. You can see the associated code for it in file_cron().

$fids = Drupal::entityQuery('file')
  ->condition('status', FILE_STATUS_PERMANENT, '<>')
  ->condition('changed', REQUEST_TIME - $age, '<')
  ->range(0, 100)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.