View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-25-2023 , 15:21   [Windows] WakeMeOnLan
Reply With Quote #8

My second PC is in another room, to able switch PC on over LAN connection:
- BIOS set to wake PC from LAN first

...I use this tool from my main PC

[Windows] WakeMeOnLan (Nir Sofer)

*edit
About BIOS setting Wake-On-LAN, to get it work again after power loss,
I also need set from BIOS Restore on AC/Power Loss so PC start automatically when PSU is powered.

Because if this feature is not enabled, my motherboard LAN connector do not turn on after power loss.

To automatically turn my PC off after 15 minutes from boot, I use crontab (Linux)
- To able to use Shutdown in cron job -> I need log as ROOT user (sudo su) and then create cron job.
My example
Code:
root@pop-os:/home/pop# crontab -l
# Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
# 
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
MAILTO=""
PATH=/sbin:${PATH}
HOME=/root

#@reboot /bin/sleep 60 && /sbin/shutdown -h 15
@reboot /bin/sleep 60 && /sbin/shutdown -h 14


When I need use my second PC
  1. I wake up with tool WakeMeOnLan
  2. Wait little bit, then connect with remote control (TeamViewer)
  3. I open Linux terminal and cancel running shutdown: shutdown -c

Last edited by Bacardi; 02-25-2023 at 15:57. Reason: more info
Bacardi is offline