August 10, 201213 yr Hi all, i looking for a solution of my problem. Im running a plex server on my unraid server and the Library is located on a cache only share on my cache drive. That causes the cache drive to run all the time. And that causes the system never going to sleep automaticly. My idea is to exclude the Cache drive from the sleep code. Thats the original sleep code. HDD_activity() { # preset no hard disk checking disks=0 if [ $checkHDD = $yes ]; then disks=$(for d in $(ls /dev/[hs]d? | grep -v "$flash"); do hdparm -C $d | grep active ; done | wc -l) fi echo $disks } Im not that good in programming, i only understand whats going on If i exclude the cache drive from the HDD_activity check, the system will go down but there will be another problem. When you copy some stuff to a cached share. The System will go to sleep... thats not good. A better Solution is to check the TCP activity. But not that way how its working now. The Script is looking for exactly 0 bits transfered in x minutes. That will never be! The idea is now. Exclude the cache drive but look for high network activity! To avoid collusion with the mover script. We can exclude the hours the mover script is working from sleep mode. We could include a Checkbox in Sleep Mode Settings like "Using Mediaservers on the Cache drive?" wich will turn this modifications on. So! Who is smart enough to help me fixing this problem? Greetings Julian
August 12, 201213 yr Author Hi again, im now into the scripts. but now im stuck. What does that part do? # check for persistent external activity if [ $(TCP_activity) -eq 0 -a $(IP_activity) -eq 0 ]; then... TCP_activity gives back a number i think. I think its looking if the average tcp activity is 0. but it would be good if it can look if the activity is below x. Is there a way?
August 15, 201213 yr Author Hey Folks, i have another idea for my problem. Is there a script wich stops the plex server when not used? Example: The script looks if someone is watching some stuff over plex. When its not and its between midnight and 08:00 oclock, the server stops and the sleep mode script will do its work correctly...
Archived
This topic is now archived and is closed to further replies.