F5F Stay Refreshed Software Operating Systems Execute basic commands during startup on a Raspberry Pi

Execute basic commands during startup on a Raspberry Pi

Execute basic commands during startup on a Raspberry Pi

A
anto2003roma
Member
80
12-17-2023, 01:32 AM
#1
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.
A
anto2003roma
12-17-2023, 01:32 AM #1

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.

T
toniogill
Junior Member
48
12-17-2023, 06:47 AM
#2
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".
T
toniogill
12-17-2023, 06:47 AM #2

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".