Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wake on LAN option to wake up the host systen #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chriss158
Copy link

@chriss158 chriss158 commented Jan 23, 2024

Hi Thomas,

Thanks for the great addon.

My backup system does not run 24/7, so I was missing the option to wake up my system before copying the backup.
This PR adds the option to do a WOL before copying the backup to the host system.

A few notes on implementation:

  • If WOL is enabled and host_mac is missing, the addon will fail on startup because the addon is misconfigured.
  • When the addon pings a DNS name, the ping output may be "ping: bad address". This seems to be a DNS issue. So I added a log message to indicate that the user should use the IP address instead.

The process of doing a WOL is as follows:

  1. Check if WOL is enabled

  2. Check if host is online

    • If the host is online

      1. Continue copying the backup
    • If host is offline

      1. Send WOL

      2. Ping host system 100 times

      3. Check if host comes up within 100 pings

        • Host comes up within 100 pings

          1. Wait another 60 seconds for the host to settle.
          2. Continue copying the backup
        • Host did NOT come up after 100 pings

          1. Cancel the backup copy with a warning

Thanks for reviewing my PR and just let me know if there is anything to change.

@thomasmauerer
Copy link
Owner

Thanks for your two PRs. I'll take a look at them on the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants