Automated Shutdown via Cron Job in TrueNAS Scale 25.10.1 (GoldEye)

I’m trying to configure my TrueNAS Scale 25.10.1 (GoldEye) to shut down automatically at a fixed time (e.g., 23:30) daily. Unfortunately, I’ve hit several roadblocks and could use some help.

What I’ve Tried So Far:

  1. Cron Job with shutdown or powerdown:
  • Direct commands like /sbin/shutdown -p now or /sbin/powerdown in a cron job fail with:

    [EFAULT] CronTask exited with 1 (non-zero) exit status.

  • Error code 127 (command not found) occurred, even though the paths seem correct.

  1. API Key
  • I couldn’t find API Keys under Credentials or System Settings (these menu options don’t exist in 25.10.1 or are renamed).
  • Searching for “API” in the web interface yielded the result to User API. Mistral (AI) sysa that’s wrong so I didn’t try.

My TrueNAS Version:

  • TrueNAS Scale 25.10.1 (GoldEye)

  • Standard installation with RAID 1 for boot.

I’m an absolut noob and just startet with my journey of a homeserver.

Thank you for helping me!

Moved to “TrueNAS General,” as this isn’t a feature request.

API keys are in the same place in the GUI where they’ve been for a long time, which is in the user menu in the upper-right corner of the screen. Click on your username (likely truenas_admin), and you’ll get a drop-down menu; from there, choose “My API Keys.” But what does this have to do with running a cron job?

As to the other, there’s no powerdown command, and your path to shutdown is incorrect–that’s in /usr/sbin/shutdown.

2 Likes

I used /usr/bin/midclt call system.shutdown “Sleep” and it worked fine.

Welcome to the forums.

The correct command when using the CRON Job is simply poweroff. Run as root.

Thx! I saw that to late to change it.

Thx for the welcome. Great community.

That command (poweroff. Run as root ) worked perfectly.

1 Like