Execute basic commands during startup on a Raspberry Pi
Execute basic commands during startup on a Raspberry Pi
I need nothing too complicated. Just want these two lines run every time I boot: pihole-up qbitorrent. All tutorials point to a .py script, which isn’t necessary. Also, would it be good to add sudo apt update && sudo apt upgrade -y to each boot? If yes, I’d like to include that as the third line.
To ensure these programs launch immediately without worrying about crashes, edit the crontab using sudo crontab -e and add: @reboot pihole -up @reboot qbittorent @reboot /path/to/your/script.sh. For automatic restarts and logging, set up systemd units. This approach is more detailed but worth a quick search for "systemd unit example".