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 of this cron run be run as an authenticated user for drupal 8.  I found some documentation but only for drupal 7 .
thanks
You can run your custom cron methods as an authenticated user as follows:

use Drupal\user\Entity\User;

/**
 * Implements hook_cron().
 */
function my_module_cron() {
  // Login as user 1
  $user = User::load(1);
  user_login_finalize($user);

  // Your custom cron functions

  // Login as user 0 (anonymous)
  $user = User::load(0);
  user_login_finalize($user);
}