how to autorun script at startup as administrator?

Thomas Kaiser ubuntu at kaiser-linux.li
Wed Dec 18 20:21:44 UTC 2019


On 18.12.19 20:45, Dave Stevens wrote:
> On Mon, 16 Dec 2019 23:24:17 -0500
> Little Girl <littlergirl at gmail.com> wrote:
> 
> Can anyone point me in the direction of a script running as admin
> without intervention?

Run it from root's crontab. Check every n minutes if the script is running, if not start it. I know it is bad, but it works.

Here is my example:
# m h  dom mon dow   command
# run every 5 minutes
*/5	*	*	*	*	/usr/bin/pgrep read_temp.sh >/dev/null || /var/www/read_temp.sh

Use "sudo crontab -e" to add a new entry to root's crontab. No need to restart.

Thomas




More information about the ubuntu-users mailing list