I did a lot of research on this and I saw a lot of ways on how to do this. However, none of it seems working for me. For example, I did something like this:
~/.config/upstart/text.config
I created a .config file under the directory mentioned above and wrote the following command (testScript.sh below is the script that i wanted to run) :
start on startup
task
exec /path/to/testScript.sh
Another way that i tried, I wrote something like this in rc.local file:
sudo -H /etc/init.d/testScript.sh start
And I put my testScript.sh in init.d. Both of these ways didn't work for me. The system didn't give me any errors or remarks. Did i make a mistake somewhere or is there another way to do this? So that my script execute automatically on the startup of the system.
update-rc.d testScript.sh enablethe proper links will be created in the various /etc/rc?.d directories. Read up on the boot process. A good place to start is wiki.debian.org/LSBInitScripts. Although newer releases of Linux systems also use systemd and Upstart. – Deathgrip Jun 5 '17 at 7:47crontabit maybe? – Fl.pf. Jun 7 '17 at 8:43