Before switching to omv I was using powernap to put my server to sleep when it was inactive.
I start a backup up every night and I would like to continue doing that using the autoshutdown plugin.
How to I get it to call my script or what script do I have to change to get my system waking up at a predetermined time as before?
Here is the suspend script that I used to use:
Bash
#!/bin/sh
#
# Simple script for getting a computer to wake up at a predetermined time using rtcwake
#
#
# What time should the server wake up at
#
WAKE_AT=04:02:00
#
# Get current time in seconds
#
NOW=`date +%s`
#
# Time in seconds for 4AM today
#
WAKE_TODAY=`date -d "today ${WAKE_AT}" +%s`
#
# Time in seconds for 4AM tomorrow
#
WAKE_TOMORROW=`date -d "tomorrow ${WAKE_AT}" +%s`
#
# Check to see if the wake up for to today is already in the past and reassign WAKE_AT to the value in seconds
#
if [ $NOW -gt $WAKE_TODAY ]; then
WAKE_AT=$WAKE_TOMORROW
else
WAKE_AT=$WAKE_TODAY
fi
#
# Log the event
#
logger "Sleeping until "`date --date=@$WAKE_AT`
#
# Suspend to memory until the desired time
#
rtcwake -m mem -t $WAKE_AT
Alles anzeigen