October 19, 2025Oct 19 Author ya thats what i already have but i wanted to keep the drives spun up from 9am to 9pm running the cron and after 9pm then it shut down after 15 minbut so far cant find the command line that spins up all the disks or least disk1 then id copy and paste for all the disks lol
October 19, 2025Oct 19 Author cuz when i use it during the day .. and spun down even with the file cache plugin it still cant go fast to access the array your sitting and waiting so thats why i wanna keep it spun up during the day but after it can spin down
October 19, 2025Oct 19 Community Expert normal actvity and call for data should spin the disk up.If they are in a spin down state. I can see needing a coamdn to spin them down or stoping the array for that period of time so no interaction is happenign at all but not a spin spin up as that should spin up and work when the next task i called.
October 19, 2025Oct 19 Author so if i using it at home i may wanna acces files off the array so i gotta wait a 1 min or 2 for the disks to spin up from standby... and if i go away for 15--20 min not doing anything .. of course spins back down.. and then once again to access unraid shares takes 1 to 2 min before the drives spin up.. and stopping the array would kill all the vms and dockers..so i trying to make it so the drives will stay spun up during the day and then it can goto sleep after 9pm if no activity at 15 min.. as i set the cron job to run ever 10 min to force the array to be spun up... i tried a spin up from 2011 ya that didnt work that was just 2 lines of code lol
October 19, 2025Oct 19 Author i triedsmartctl -i -n idle /dev/sddto get the drive out of standby mode figured idle is spinup but it didnt like that either lol
October 20, 2025Oct 20 Author @bmartino1 i ended up getting your code to work kinda.. it wasnt working but i had to reboot my unraid box and this morning i tested it after 8am and the script through erroras the if statement doesnt like "08" for 8amwhen you use if (( HOUR >= START_HOUR && HOUR < STOP_HOUR )); thenso i played with just stripping everything and ran in a script#!/bin/bash#!/usr/bin/env bashset -euo pipefail# Log fileLOG_FILE="/var/log/unraid-keep-spunup.log"########################################## INTERNALS#########################################HOUR=$(date +%H)CSRF=$(grep -Po '^csrf_token="\K[^"]+' /var/local/emhttp/var.ini || true)COOKIE=/tmp/unraid.cookiescurl -sS -k --fail -e "http://localhost/Main" \-c "$COOKIE" -b "$COOKIE" \--data "csrf_token=${CSRF}&cmdSpinupAll=Spinup" \http://localhost/update.htm \|| curl -sS -k --fail -e "https://localhost/Main" \-c "$COOKIE" -b "$COOKIE" \--data "csrf_token=${CSRF}&cmdSpinupAll=Spinup" \https://localhost/update.htmnow when i did that it didnt spin up any drives the logs showedparent.document.getElementById('progressFrame').style.zIndex = 10;origin = parent.location.origin;search = parent.location.search;function replaceName(name) {var x = search.indexOf("name=");if (x>0) search = search.substring(0,x+5) + name;}function replaceOrigin(new_origin) {origin = new_origin;}function addLog(logLine) {document.body.innerHTML += logLine;window.scrollTo(0,document.body.scrollHeight);}function disablePage() {setTimeout(function(){parent.document.getElementsByClassName('spinner fixed')[0].style.display = 'block';},500); // show spinner when operation takes longer than 0.5sfor (var i=0,element; element=parent.document.querySelectorAll('input,button,select')[i]; i++) element.disabled = true;for (var i=0,link; link=parent.document.getElementsByTagName('a')[i]; i++) link.style.color = "gray"; //fake disable}function enablePage() {parent.location.assign(origin + parent.location.pathname + search);}disablePage();Script Finished Oct 20, 2025 08:22.14Full logs for this script are available at /tmp/user.scripts/tmpScripts/test2/log.txtin the end the only way things worked for me waswas cron */10 9-21 * * *and script to# Keep The Drives Spun Up 9am to 9pm Running every 10 Min# cron 10 9-21 * * *#for disknum in ls /dev/md* | sed "sX/dev/mdXX"; do /root/mdcmd spinup $disknum; done#for disknum in ls /dev/md* | sed "sX/dev/mdXX"; do /root/mkdir /mnt/$disknum/abctest; donetempdir="testabc"mkdir /mnt/disk1/$tempdirmkdir /mnt/disk2/$tempdirmkdir /mnt/disk3/$tempdirmkdir /mnt/disk4/$tempdirmkdir /mnt/disk5/$tempdirmkdir /mnt/disk6/$tempdirmkdir /mnt/disk7/$tempdirrmdir /mnt/disk1/$tempdirrmdir /mnt/disk2/$tempdirrmdir /mnt/disk3/$tempdirrmdir /mnt/disk4/$tempdirrmdir /mnt/disk5/$tempdirrmdir /mnt/disk6/$tempdirrmdir /mnt/disk7/$tempdirthis seems only way that worked not what i wanted but i guess it will do.. maybe i need to request a feature request where its built in where you can have the array be spin up in a certain hoursor have 2 command lines Spinup -All or Spinup <disk1> and Spindown -all or Spindown <disk1> so u can just easily run it from command line
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.