Skip to content

Systemctl Utils

Lean's edited this page Jan 29, 2026 · 4 revisions

Run program after boot

  • sudo vim /etc/systemd/system/myscript.service/
[Unit]
Description=This will run after Boot

[Service]
Type=simple
ExecStart=program/location

[Install]
WantedBy=multi-user.target
  • systemctl enable myscript.service

Timer execution

  • sudo vim /etc/systemd/system/customscript.service
[Unit]
Description=My custom script

[Service]
Type=oneshot
ExecStart=/usr/local/bin/custom_script.sh
  • sudo vim /etc/systemd/system/mytimer.timer
[Unit]
Description=My custom timer that will exec all tuesday 8 pm

[Timer]
OnCalendar=Tue 20:00:00
Persistent=true

[Install]
WantedBy=timers.target
  • sudo systemctl enable --now mytimer.timer

Clone this wiki locally