garycase Posted September 16, 2012 Share Posted September 16, 2012 I can easily turn on my UnRAID server remotely via a simple WOL command; but there are two other things I'd like to be able to do just as easily -- and I'm not sure how (if at all) these can be done. (1) Spin up all the disks. Clearly this is trivial with the Web interface (just click the button) ... but what I'm looking for is a simply command that can be executed as a batch file (or a scheduled task) to spin up all the disks a couple minutes before a scheduled middle-of-the-night backup utility runs. {Yes, they'll spin individually as needed, but I'd like the server to simply be at full speed when the backup starts). (2) Shut down the server. Again, simple with the web interface -- but is there an easy way to do this from a Windows command line? I know there's a simple utility that will let me schedule an automatic shutdown at a specified time -- but I'd like to do it when a specific batch file that can take a widely variable time to run has completed. Quote Link to comment
bobbintb Posted September 17, 2012 Share Posted September 17, 2012 1) here the spindown function from unmenu. shouldnt be too hard to wrap that in a bash script. there might already be something easier but i dont know. function SpinUp( disk, cmd, f) { # Spin Up drives # loop through the drives spinning them up by using the spinup command if available or # by reading a single "random" block from each /dev/md* device in turn if not. srand() # important to get random numbers when unmenu is re-started. for ( i =0; i<numdisks; i++ ) { #print disk_name[i] ORS if ( disk_name[i] == disk || disk == "All Disks" ) { if ( has_spinup == "true" ) { cmd="/root/mdcmd spinup " i " >/dev/null 2>&1" } else { # calculate a random block between 1 and the max blocks on the device skip_blocks = 1 + int( rand() * disk_size[i] ); #cmd="dd if=/dev/" disk_device[i] " of=/dev/null count=1 bs=1k skip=" skip_blocks " >/dev/null 2>&1" cmd="dd if=/dev/" disk_name[i] " of=/dev/null count=1 bs=1k skip=" skip_blocks " >/dev/null 2>&1" } #print cmd ORS system(cmd); } } } 2) windows command line? no. but check the wiki for the powerdown script and you can easily do if from a terminal. Quote Link to comment
Joe L. Posted September 18, 2012 Share Posted September 18, 2012 See here: http://lime-technology.com/forum/index.php?topic=22006.msg195337;topicseen#msg195337 Quote Link to comment
garycase Posted September 20, 2012 Author Share Posted September 20, 2012 Thanks Joe, Invoking a web page with the "Spin Up" or "Spin Down" commands works just fine. Quote Link to comment
The_Keymaker Posted October 9, 2014 Share Posted October 9, 2014 This command: http://tower/main.htm?cmdSpinUpAll=Spin%20up works fine for my OLD version (4.7) of unRAID to spin up all drives. Can someone post the actual HTTP command (similar to form of the above command) for versions 5.0 and above? Thanks The_Keymaker Quote Link to comment
cirkator Posted September 13, 2015 Share Posted September 13, 2015 Sorry for bringing up this old thread, but I would like to know if there exists a command to spin up all disks via a URL in v6. I have tried "http://tower/update.htm?cmdSpinUpAll=Spin%20up" and "http://tower/main.htm?cmdSpinUpAll=Spin%20up" but both didnt work. I get a 404 file not found. I checked the website source code and i guess these are the interesting lines: <form name="otherOps" method="POST" action="/update.htm" target="progressFrame"> <input type="hidden" name="startState" value="STARTED"> <table class="array_status"> <tr> <td></td> <td><input type="submit" name="cmdSpindownAll" value="Spin Down" style="width:80px"><input type="submit" name="cmdSpinupAll" value="Spin Up" style="width:80px"></td> <td><strong>Spin Down</strong> will immediately spin down all disks.<br><strong>Spin Up</strong> will immediately spin up all disks.</td> </tr> Any ideas? Quote Link to comment
BRiT Posted September 13, 2015 Share Posted September 13, 2015 Sorry for bringing up this old thread, but I would like to know if there exists a command to spin up all disks via a URL in v6. Yes. Use the search feature to find a recent thread that has the solution. There was one just a few days ago. Quote Link to comment
BRiT Posted September 13, 2015 Share Posted September 13, 2015 http://lime-technology.com/forum/index.php?topic=42661.msg406217.msg#406217 Quote Link to comment
cirkator Posted September 13, 2015 Share Posted September 13, 2015 Thanks BRiT, i tried the search function but used different search words. Exactly what i was looking for! Quote Link to comment
Recommended Posts
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.