Run command or script on linux startup

From DevOps Notebook
Revision as of 18:14, 7 June 2020 by MilosZ (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

There are few ways.

1. With /etc/rc.local (edit file and add script you wanna run, before that chmod +x myscript.sh)

2. Using crontab (run crontab -e)

@reboot /path/to/script

3. Using systemd