Skip to content

carlox97/Schedule-Laptop-Shutdown-on-Battery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Schedule Laptop Shutdown on Battery

wget https://github.com/carlox97/Schedule-Laptop-Shutdown-on-Battery/raw/main/schedule.c
mv schedule.c /root/schedule.c
gcc /root/schedule.c -o /root/schedule
chmod +x /root/schedule

create a CronJob (run every 5 minutes)

sudo nano /etc/systemd/system/schedule.service

Paste & Save

[Unit]
Description=Run schedule executable

[Service]
ExecStart=/root/schedule

Then

sudo crontab -e

Paste & Save

*/5 * * * * /bin/systemctl start schedule.service

About

Laptop as a Linux Server: Automatically schedule Shutdown when running on battery during a Power Outage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages