Just a quick update to share some interesting findings re S3, as I have found a way to use automatic S3 Sleep and still get mover and parity check to work automatically daily/monthly. Here is what I do:
1) In the disk settings, I set the array to auto start and the default spin down delay to 15 minutes. The Windows VM is also set to auto start, but that doesn't really play on S3 resume as S3 sleep doesn't shutdown the VM.
2) In the S3 plugin settings, I set the execute function to sleep, excluded days to none, excluded hours to 01:00 - 02:00, and the wait for array inactivity to yes, exclude cache (so that a VM/Docker on idle doesn't keep the system active). I keep status and counters and I set the extra delay after array inactivity to 45 minutes. This means that it will take 60 minutes of array inactivity (excluding the cache) before S3 kicks in.
3) Then I also set "Wait for network inactivity" to yes, to make sure that if the VM is active (usually updating the Dune metadata or running a CCC) it doesn't go to sleep. Also If I'm ripping disks to the array, they will go to the cache so would be ignored, so I need the ethernet activity to keep the server alive during a rip. I will probably need to fine-tune the idle threshold, but for now I set it to Medium traffic (100kb/s).
4) Finally, I set the WOL options before sleep to g and I add the following script (found on the CMC forums) to wake the server up at 01:00am every day, so that mover can run automatically every night and parity check can run after it every month. This script uses the RTC clock to wake up the server at 01:00 every night if needed. That's the time my other servers are programmed to switch off if they are on, as I'm not watching anything or working by then. You can add more wake-up times in the array (below the 01:00) if needed. The main thing to remember is that for the scrip to work, the server has to be sent to sleep by the S3 plugin (automatically). If you request a manual sleep, the script won't run and the server won't wake up. Here is the script:
# #####################################
# ######### Settings ##################
# #####################################
times=(
01:00
)
# #####################################
# ######### Script ####################
# #####################################
# sort times
readarray -t times < <(for a in "${times[@]}"; do echo "$a"; done | sort)
# delete wakealarm
echo 0 > /sys/class/rtc/rtc0/wakealarm
# loop through times
for time in "${times[@]}"; do
now=$(date +%s)
fut=$(date -d $time +%s)
if [[ now -ge fut ]]; then
fut=''
continue
fi
# set wakealarm
echo $fut > /sys/class/rtc/rtc0/wakealarm
logger -t wakealarm "set wakealarm to "$(date -d "@$fut")
done
# set wakealarm for the next day
if [[ -z $fut ]]; then
fut=$(date -d "tomorrow ${times[0]}" +%s)
echo $fut > /sys/class/rtc/rtc0/wakealarm
logger -t wakealarm "set wakealarm to "$(date -d "@$fut")
fi
5) I schedule mover to run at 01:05 every night, and I schedule parity check to run at 02:00 every 1st day of the month. My parity check takes 8 hours on the server with 10 4TB (+2 parity drives), and 12 hours with the server with 4 6TB (no parity yet). It might be because these drives are slow, I'll test with other drives. The idea is that because it takes 60 minutes of inactivity before S3 kicks in, and I've excluded 01:00-02:00 anyway, it gives 55 minutes to mover to do its job (usually I'll have at most two UHD blurays to move at the end of a ripping day, if I have more then I'll move them manually). By the time we get to 02:00, either we're not the first and S3 sleep kicks in 60 minutes after mover is done, or we're the first and the parity check starts. It should be finished at the latest around 14:00, which is fine by me as I rarely watch films in the morning.
So with this set-up, the server goes to sleep after 60 minutes of array AND ethernet inactivity, wakes up at 01:00am every night to run mover, and does a parity check after that once a month. It goes to sleep automatically when that's done if there is no activity.
I've tested it last night with a parity check set to the 28th (today) and it worked fine.
Given that CMC supports WOL (thanks again Paul!), I don't even have to wake up the server(s) manually to play a film. If it's on the server, CMC wakes it up and plays the film. The only time I really need to wake up the servers is when I rip something manually or do some collection management. In that case I prefer to wake up all the servers anyway, as it speeds up MyMovies CM considerably. MyMovies is set to wake up all the servers when I launch CM on the main MM server (not when I launch CM from a client). If I need to do it manually, I use the Asus app for my router or I use the excellent WakeMeOnLAN windows app (
https://www.nirsoft.net/utils/wake_on_lan.html) from a desktop/laptop.
I hope this will help someone.