LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run script at startup or after login (https://www.linuxquestions.org/questions/linux-newbie-8/run-script-at-startup-or-after-login-4175434847/)

dushyantgohil 10-31-2012 12:32 AM

run script at startup or after login
 
hi,

i have one script which i want to run at boot time or after login can any one help me, how to do this.

jsaravana87 10-31-2012 01:31 AM

If you want the script to be execute on system boot time. You can set @reboot parameter in cron

@reboot /path/to/script


http://www.thegeekstuff.com/2009/06/...ntab-examples/
http://www.cyberciti.biz/faq/linux-e...system-reboot/

John VV 10-31-2012 04:03 AM

or
if it is cent and depending on what it is you need to do
create a script and drop it in "/etc/profile.d"

but be VERY careful that is dose NOT conflict with some other script that is NEEDED

v11pandey 10-31-2012 04:15 AM

need to give execute permission for the script placed under /etc/profile.d/

jv2112 10-31-2012 04:22 AM

:twocents:

Another option is to include in a start up file like /home/user/.xinitrc or /home/user/.config/openbox/autostart . Depends on your set up. ( XFCE , GNOME , Openbox et cettera).

adol83 10-31-2012 05:59 AM

/etc/init.d/rc.n

here you can set the "Snn" process and the "Knn" process where "nn" is the number of the process. I warn you do not edit existing files because your system could not boot up anymore.

John VV 10-31-2012 03:01 PM

it boils down to
just WHAT is it doing
what dose it need to do
then the "best" ( or a "good" place) and or how it is ran can be determined

a start up cron job
a user specific session
universal settings
a back up script
and so on


All times are GMT -5. The time now is 03:24 AM.