Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[solved] editing s3.sh and spin up?

Featured Replies

I have my server back up and running and I want to make a few changes to fine tweak it to get it running perfectly for me.

 

I came across a problem I didn't foresee. I have decided to put all my DVD rips on the Unraid and the BD rips locally on my media players internal 3TB HDD. I have got all the timers in the s3.sh and spin down timers set exactly how I want them but this causes a problem if I want to watch a DVD rip after a BD rip (E.G. Iron Man BD followed by Iron Man 2 DVD) because by the time the BD has finished the timers have timed out and the Unraid has gone to sleep. Which means I have to either boot the computer to send a WOL packet, reboot the media player (which sends a WOL on startup) or go right down to the basement to press the power button. I have done some searches and found that some people have added a "ping IP address" line to the s3.sh so their Unraid will only sleep if all the disks have spun down AND the client is not ping-able. The problem is no body has posted the code or where to put the code in the script.

 

My question is what do I have to do to get this to work with my sleep script? a link to a page would be helpful or an example of a working code, I have been searching all day and read through hundreds of posts and am still non the wiser.

 

Below is the script I have running at the moment.

 

#!/bin/bash

drives="/dev/sda /dev/sdb /dev/sdc /dev/sdd  /dev/sde /dev/sdf /dev/sdg/dev/sdh /dev/hdb"
timeout=60


count=60
while [ 1 ]
do
  hdparm -C $drives | grep -q active
  if [ $? -eq 1 ]
  then
    count=$[$count-1]
  else
    count=$timeout
  fi
  if [ $count -le 0 ]
  then
    # Do pre-sleep activities
    sleep 5

    # Go to sleep
    echo 3 > /proc/acpi/sleep

    # Do post-sleep activities
    
    sleep 5

    count=$timeout
  fi
  # Wait a minute
  echo COUNT $count
  sleep 60
done

 

 

On a side note, do all the drives have to spin up when the server comes out of s3?

  • Author

Does [ANYBODY/u] have a sleep script that checks to make sure the drives are spun down AND pings IP adresses to make sure there are no clients running? I have been trying to work it out myself, based on the sleep script in the wiki, but I have absalutely no idea what I am doing.

  • Author

Sorry for the late reply, been away for a few days over xmas. I have downloaded the script, thanks by the way...i'd have had no chance of working all that out.

 

Where would i edit the script to meet my needs. Timers, which HDD's to check, which IP's to ping etc? Do i just edit the configuration area? or do is that just an indicator of where to edit in the implementation stuff?

 

 

And you need also bwm-ng installed

 

And it check all your disk in your server automatic in this section check_HDD_activity()

 

And I have remarked the mover function in this script

 

pre_sleep_activity() {
        #/usr/local/sbin/mover
#echo $(date) Mover Complete
sleep 5
/bin/sync
echo $(date) Sync Complete

}

  • Author

sweet, cheers buddy. will give it a whirl this afternoon.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.