-1

I have an application which I was running by using ./cmd from the directory where it is located. Now what I am looking for something by which the application starts automatically when my system boots up. I came across some suggestion saying write a script, do something in init.d, etc. But I am not able to reach a clear solution.

Request you kindly provide your valuable suggestion on same.

1 Answers1

0

This answer might help you: https://askubuntu.com/a/816/278518

Don't forget to put the whole path in the crontab file. Meaning, after running crontab -e your editor opens with the crontab file so you can add a new line to it. On that line, if your script is let's say in

~/mycoolscript.sh

you have to write the new line in your crontab file as:

@reboot /bin/sh /home/_your_username_/mycoolscript.sh 

since cron does not evaluate shortcut paths and also does not run shebang scripts.

Hope this helps.

  • If you think the question is a dupe, and an existing answer applies to this question, please don't point to the answer in a new answer, nor repeat the answer here. – Jacob Vlijm Mar 10 '16 at 11:30
  • @JacobVlijm you're right. It's just I'm not allowed to comment :( – alexandru Mar 10 '16 at 13:22