PDA

View Full Version : [ubuntu] auto script from home directory



akkad
April 23rd, 2009, 09:32 PM
i have a script in my directory "/home/myuser/folder/script.sh", how can let this script to run on boot automatically.

.nedberg
April 23rd, 2009, 09:55 PM
If you want it to run when you log in, you can go to System -> Sessions and add it to "Startup programs".

If you want to run it at boot you can add a line in /etc/rc.local before "exit 0"

akkad
April 23rd, 2009, 10:05 PM
am using ubuntu server, so i want to be on boot but using command line ??

.nedberg
April 23rd, 2009, 10:09 PM
You can use nano to edit the file:


sudo nano /etc/rc.local

Add a line with


/home/myuser/folder/script.sh

before "exit 0" at the bottom. Save with Ctrl+o (the hit enter), exit with Ctrl+x.

If your script is something that goes into a loop, or doesn't return in any other way, use this in rc.local


/home/myuser/folder/script.sh &

MOBIDON1
January 30th, 2011, 10:00 AM
I am using ubuntu 10.04 and i want to make "autoupdate" script at home and schedule it to run at 2:15am.
Command line plz...?

EkiLibRiuM
September 27th, 2012, 03:36 PM
I am using ubuntu 10.04 too nd i try to execute some command's but the answer is not a located file ...i don' know what is wrong but i have some probel mto be root too...