DisplayNerd

Members
  • Content count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About DisplayNerd

  • Rank
    Newbie
  1. Thanks. Where is a good folder to put the PHP/Bash scripts I'm going to make? Should I just make my own scripts folder inside config, is there a better place where i could put scripts in, or is one provided by Unraid. If it is, I can't find it. Also how would you restart the array upon wakeup? Is it same terminology except cmdStart=Start? I assume the script would just pause until resuming so I could put it as the next command after the sleep command to start the array upon wakeup. Would this be the right thing to do?
  2. Just learned a little PHP. If the end result can take fewer lines or there's errors in my script, please feel free to edit it. I'm a total noob. Add on to Squid's script: $file = "file location"; $handle = fopen($file, "w"); fwrite($handle, "Execute"); fclose($handle); Script to check if executed by user or sleep script after array stop: #!/usr/bin/php <? $file = "file location"; $output = file($file); $start = FALSE; foreach($output as $line) { if(strcmp($line, "Execute") == 0) { $start = TRUE; } } if($start == TRUE) { $handle = fopen($file, "w"); fwrite($handle, "DontExecute"); fclose($handle); exec("bash ./[Location of script]/sleepscript.sh"); } ?> Still don't know best place to save file.
  3. Correct me if im wrong (i don't know any PHP but i have programmed before) but it seems Squid's script for stopping down the array shuts it down as if you clicked the stop button from the browser. I would assume you'd have to pass data (like a boolean value saved in a file whether the stop script was executed or not) from one script to the next if using the event system would be the path you took. And as I've said before, I don't know any PHP (though this does seem like a pretty simple feat). I'll see if i can find any vids that teach you if statements and saving flies in PHP. P.S. Where would be a good place to store one such file? Somewhere in /tmp I presume. Can you do this without saving a file?
  4. Yeah. Should've thought about that
  5. Thanks squid and bonienl. So I think what would be best would be to make a script to stop the array when the disks spin down using squid's PHP. Then make another script that uses the event system in unraid bonienl suggested to put the array in sleep. Is there an unraid event state that the disks have spun down as well?
  6. Thanks guys! Is 15 seconds good? So, just to be clear /mnt/user will disappear after the array stops. Right?
  7. Thanks Squid for your help, and thank you bonienl for the suggestion. I doubt the S3 sleep plugin is supported on my system as cat /sys/power/mem_sleep only prints s2idle and standby. Not deep as s3 sleep would give (and visual conformation, my server didn't turn off when I put it to sleep when I used it as an actual computer for a little while). I was thinking to write "standby" to /sys/power/mem_sleep and then write "mem" to /sys/power/state. P.S. Does anyone a way you could check the state of whether the array is fully stopped so I can sleep when the operation is complete? I don't really care if the drives spin up after the array stops, putting it in sleep spins them down again, I think.
  8. I've been wanting to make a script to put my server to sleep when not using it and want to stop the array after the drives have spun down (for extra security) and then put the server to sleep. I kind of know how to put it to sleep and find out if the drives have spun down as there's threads on that, but I can't find out how to stop the array through the terminal. Anyone can help me?

Copyright © 2005-2018 Lime Technology, Inc.
unRAID® is a registered trademark of Lime Technology, Inc.