Autoshutdown and suspend to mem with rtcwake

  • 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:


    • Offizieller Beitrag

    Install the openmediavault-wakeonlan plugin. It has an rtcwake tab.

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • The WOL plugin is for a one off rtcwake and not for a scheduled wake up in combination with an automated suspend.


    I've had a look at the pm-utils package, which I think the plugin uses but I can't figure out exactly where to define my script/

    • Offizieller Beitrag

    I recommend the WOL plugin because it installs rtcwake. You could just execute the rtcwake command (same as your script uses) with a scheduled job (daily) and use the autoshutdown plugin to put your system to sleep.

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Calling rtcwake suspends the system to memory so a scheduled suspend isn't really going to give me the functionality that I need.


    As I said in my OP, I'm looking for a way to call my script instead of the standard suspend but I don't know my way around the pm-utils package to get this to work.


    What would be really cool is if the autoshutdown maintainer could add a "scheduled wake up at" option to do this out of the box.

    • Offizieller Beitrag

    Calling rtcwake suspends the system to memory so a scheduled suspend isn't really going to give me the functionality that I need.


    You didn't look at the options of rtcwake... There is an option "No - Don't suspend. Sets RTC wakeup time only."


    If you want an option added to autoshutdown, file an issue here.

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    pm-utils also provides hook scripts for the designated folders. if you want to run scripts after a state.


    /etc/pm/sleep.d/ I'm guessing?

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • You didn't look at the options of rtcwake... There is an option "No - Don't suspend. Sets RTC…


    I'm sorry, I didn't realize that the rtc event would still happen doing it that way and now it also makes perfect sense what you said before about a cron job.


    I think that I shall try that out.


    I use drivish to make incremental backups and have that run 2 minutes after the scheduled wake up time.


    I'll give it a try this evening and let you all know how it works out.


    Thanks

  • I meant to get back about this before but I forgot.


    Adding a script to "/etc/pm/sleep.d" was the solution with authshutdown installed.


    I have added a script called "01-set-wakeup" and set it executable.



    This gets called when pm-suspend is called and set the RTC to wake up my server at 22:00 local.


    At 22:04 my backup is started by cron and dirvish mounts my external USB drive, does an incremental backup and then unmounts the drive.


    It would be nice if enabling and setting the time was a standard part of the WOL-RTC plugin though.


    So I'm happy that my backup is now running automatically every evening.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!