I'm setting up a cron job to suspend and wake a server at certian times.
I'm using two commands. One to be run from mondays to thursdays:
rtcwake -m mem -t $(date +%s -d "08:00")
And another one to be run on fridays:
rtcwake -m mem -t $(date +%s -d "monday 08:00")
I wonder if it's possible to make this separation unnecessary. If date
could understand a statement like next weekday 08:00
, it'd simplify things a lot.
I wasn't able to find if this is actually possible or what syntax should I use.
I basically want to avoid my server waking up on saturdays and sundays.