I was wondering how to run scripts when my computer starts up. So I dont have to run scripts manually that I always run.
Please and thank you.
|
I was wondering how to run scripts when my computer starts up. So I dont have to run scripts manually that I always run. Please and thank you. |
||||
|
|
Depending on what sort of scripts you need to run.. For services and the like you should use upstart. But for a user script these should be launched as session scripts by gnome! Have a look under System > Preferences > Startup Applications. On a side note if you need some scripts to be run on terminal login you can add them to the .bash_login file in you home directory. |
|||||
|
|
One approach is to add an @reboot cron task. Running Adding a line like this to it:
will execute that script once your computer boots up. |
|||||||||||||||||||||
|
|
There are different ways to automatically run commands:
|
|||||
|
|
For simple things you can add a command in System->Preferences->Sessions pointing to the location of your script. Alternatively you can add it to /etc/init.d/rc.local or make an upstart job if it's a more low level stuff. Take a look at https://help.ubuntu.com/community/UbuntuBootupHowto for more info |
|||
|
|
|
How about adding the command to
|
||||
|
|
|
You should use upstart for this. Upstart is used for Ubuntu processes that are automatically started. It is an enhanced solution like the old System-V init.d scripts. It also allows you to put in prerequisites to the start of your script (i.e. do you need the network running? etc.) |
|||
|
|