Score:0

Execute Bash Script at startup

it flag

I'm working on a PC with this linux version: "Ubuntu 18.04.3 LTS (GNU/Linux 4.4.194 (RK3399_WED-3399LE-V11_g8f3e4d8e8b54) aarch64)"

I made a bash script that should be executed ad start up and to do that I tried to ways:

  • Made a service for the bash script but didn't work

  • Added the script part to user crontab and the scrpt it is executed.

    @reboot home/admin/startup-checks.sh
    

Unfortunately I must run the script with sudo, but if I add the script path to the root cron (sudo crontab -e) the script is not executed.

Is there something I'm missing.

Thank you!

Raffa avatar
jp flag
`home/admin/startup-checks.sh` should be `/home/admin/startup-checks.sh` is this how it looks in crontab or was it a typo? ... Also, showing us the contents of your script might help us understand why it doesn't execute under the root user.
hu flag
Use `/etc/rc.local`
Federico avatar
it flag
@Raffa ot was a typo. The crontab entry is "@reboot root /home/admin/script/startup-checks.sh
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.