Mastering System Events: Script Execution With @Reboot And Systemd

system events
scripts
crontab
startup
suspend
shutdown
systemd
This article provides a detailed explanation of how to run scripts before and after system events such as startup, suspend, and shutdown. It covers using the `@reboot` command with `crontab -e` for startup event management and explains how to write scripts in `/lib/systemd/system-*` directories for handling other system events.
Published

October 10, 2023


execute script before & after system events like startup, suspend & shutdown

for startup use @reboot with crontab -e

for others, write scripts under /lib/systemd/system-*