Harpz Posted July 13, 2013 Share Posted July 13, 2013 Hi I used to use SF to get my server to go to sleep between 11pm - 6am, I've since stopped using SF and gone back to the stock GUI and unMenu due to a few niggling bugs. One thing I'm missing is the ability to sleep the server between these times, how does SF do the whole sleep thing and is it possible to do the same with out SF or its Sleep module installed, can it be done via the go script or something? Thanks in advance. Link to comment
Harpz Posted July 15, 2013 Author Share Posted July 15, 2013 I take it those that sleep there server between specific times do so with SF then? Is it possible to just run SF Sleep module without the rest of the SF package? Link to comment
Flibblebot Posted July 15, 2013 Share Posted July 15, 2013 The easiest way is to add the sleep command to your crontab file. Add the following lines your go script: # Set a daily sleep in root's crontab: # Append new entries to root's crontab: cat <<-EOF >> /tmp/crontab.root # Send server to sleep at 23:15 every day 15 23 * * * echo -n mem > /sys/power/state EOF # Update root's crontab: cp /tmp/crontab.root /var/spool/cron/crontabs/root- crontab /tmp/crontab.root -u root You may want to do a few other things, such as check for network or activity, run the mover before sleeping, etc. You'd need to put these things in a script and call the script from cron instead. Take a look here for further information - although read through to the end of the thread, as there are a few changes that need to be made to the posted script. I don't know how you'd go about waking the server up at a specified time - I think you'd have to get another machine to send a WOL command at 6am? Link to comment
Harpz Posted July 15, 2013 Author Share Posted July 15, 2013 Thanks for the reply you lost me at crontab file guess i got lots to learn lol, can you point me in the correct direction? Link to comment
Flibblebot Posted July 15, 2013 Share Posted July 15, 2013 cron is the tool that lets you schedule tasks at a given time or time interval. The commands and times for those commands to be run are stored in the crontab for each user. unRAID already uses cron to run the mover on a regular basis. There's quite a useful article here about cron, but there's tonnes more information if you search for "cron" on Google Link to comment
Harpz Posted July 15, 2013 Author Share Posted July 15, 2013 Ok will defiantly look that over, didn't want to have to reinvent the wheel as SF sleep used to work without any problems. Link to comment
SlrG Posted July 18, 2013 Share Posted July 18, 2013 You could also extract the "s3_sleep" script and the "bwm-ng" binary from the simpleFeatures.s3.sleep-1.0.10-i486-1.txz file that comes with simplefeatures. After you installed the package both are under /usr/local/sbin/. Place them on your flash and make sure they are copied to this folder on boot and the s3_sleep script gets executed with the parameters you want. (add the respective commands to your go file) Link to comment
Harpz Posted July 18, 2013 Author Share Posted July 18, 2013 Afraid that sounds well over my head any chance of a little how to? Link to comment
SlrG Posted July 19, 2013 Share Posted July 19, 2013 I extracted the files for you. They are attached to this post. Unzip the folder to the root of your flash drive and edit your "/boot/config/go" file to call the s3_sleep script with your needed parameters. To find out the parameters open a shell (telnet to your server), enter "cd /boot/s3sleep" to go to the directory on your flash and enter "s3_sleep -h". The line you add to your go file will look like this (parameters will propably differ for you): /boot/s3sleep/s3_sleep -a -c s3sleep.zip Link to comment
Harpz Posted October 2, 2013 Author Share Posted October 2, 2013 Hi SlrG/ Anyone Else Finally got around to thinking about trying this had a few other issues to sort out before i touched the server. Am i correct in thinking the following command will do what i want? /boot/s3sleep/s3_sleep -a -c -F -S -h 6 -h 7 -h 8 -h 9 -h 10 -h 11 -h 13 -h 14 -h 15 -h 16 -h 17 -h 18 -h 19 -h 20 -h 21 -h 22 -h 23 -m 5 -C 1 I want to sleep the server between the hours of 00:00 - 06:00 ignore the cache drive and and wait for 5 mins of array inactivity before sleeping. The -F to force Gigiabit speeds i wasn't sure about and does the -S enable sleep or sleep the server as soon as its executed. If i put that in my go file it should be fine, correct? Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.