How to run a script automatically when AIX version 7 server reboots?

Thread Tools Search this Thread
Operating Systems AIX How to run a script automatically when AIX version 7 server reboots?
# 1  
Old 07-15-2011
How to run a script automatically when AIX version 7 server reboots?

Am new to AIX please help me. I have AIX7 server. When ever the system reboots my script need to run automatically. This will help me to start my application automatically after the server reboot.

Prince Wells
# 2  
Old 07-15-2011
put your script in this file


# 3  
Old 07-15-2011
I have lot of rc1.d, rc2.d,rc3.d and init directories in /etc/rc.d

Where i have to add my script? Please help me.
# 4  
Old 07-15-2011
check /etc/inittab file
- Just create a script file in /etc called rc.myscript and put your startup command in the file
- edit your inttab and this line:
myscript:2:once:/etc/rc.myscript > /dev/null 2>&1

# 5  
Old 07-15-2011
Originally Posted by itkamaraj
- edit your inttab and this line:
ahem, ... yes and no. While this is certainly true and will certainly work one should - out of habit - use the mechanisms the OS offers to do so. In this case this means to use the command mkitab.

Be sure to read the man page of mkitab before you do that.

I hope this helps.

# 6  
Old 07-15-2011
I still believe that applications should be started from /etc/rc.d/rc2.d via link - the startscript itself should be in /etc/rc.d/init.d) while service-like applications like cluster software, security software and alikes should be started from inittab.

It is a pain when the system doesn't boot because some application script started from inittab doesnt work or is started at the wrong time of the system boot sequence - or even worse because the entry in inittab is wrong / not working at all - and I myself prefer to rename scripts in init.d when I do not want them to start for any reason rather than to over and over modify inittab - but this might be just personal taste.

# 7  
Old 07-19-2011
My friend .. there is file under /etc called rc in the end of that file just put your script and it'll be automatically started after the reboots

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AIX reboots

Hi Everyone, I'm trying to figure out how many times my LPAR has been bounced? Anybody know a command or a place I can look into. The "who -b" shows the last system boot and I couldn't find anything useful using the "last" command. (8 Replies)
Discussion started by: zroz9
8 Replies

2. Shell Programming and Scripting

How to run script automatically every 12 hour once?

Hi ! all, I have once script to remove temporary cache and temporary xml files looks like this, as it is taking more space, I would like to run automatically every 12 hour once, and then I want to receive some log as acknowledgement #!/bin/sh echo "Removing logs and temp files (typically... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies

3. AIX

mq upgrade from version 6 to 7 in aix server

Hi What are the steps to be followed when upgrading MQ version from 6 to 7 in aix server? cbsdbprd01 # oslevel -s 5300-10-01-0921 cbsdbprd01 # lslpp -l | grep -i mq mqm.base.runtime COMMITTED WebSphere MQ Runtime for mqm.base.samples ... (0 Replies)
Discussion started by: samsungsamsung
0 Replies

4. Shell Programming and Scripting

variable has no value if run the script automatically/scheduled

Hi All, I am using ksh as the shell. I have a script that should store variable after executing "onstat" on informix. I can execute it successfully without any issue if run manually, however the value is not showing up when run automatically(scheduled). Is there anything needed to make the... (1 Reply)
Discussion started by: tungaw2004
1 Replies

5. Shell Programming and Scripting

How to run a script automatically

Hi All, How can i run a script every week automatically. Thanks & regards, Sam (5 Replies)
Discussion started by: sam25
5 Replies

6. Shell Programming and Scripting

Automatically run bash script

Hi! I want to run/execute a bash script automatically everytime when a specific file is created or when its timestamp changes. Is this possible? How? Thank you very much for your answers in advance, Regards, Christoph (1 Reply)
Discussion started by: ckofler
1 Replies

7. Shell Programming and Scripting

how to run shell script automatically

hi , i m trying to run bash scrip automaticially but i dont know how i can do this an anybody tell me how i can autorun shell script when i logon . thanks (9 Replies)
Discussion started by: tahir23
9 Replies

8. UNIX for Dummies Questions & Answers

how to run a Script automatically

How to make a script run automatically using a cron?? i do not know abt cron...... if i have file and i need this to run everyday at a particular time what needs to be done thanks in advance (4 Replies)
Discussion started by: hamsa
4 Replies

9. UNIX for Dummies Questions & Answers

How to run a script automatically ?????

Hi All, How to run a script automatically using cronjob everyday from Monday to Friday 9A.M to 5P.M at an interval of ONE HOUR.I want the complete syntax means how to put in the cron job and there after. URGENTLY NEED HELP THANKS IN ADVANCE CHEERS Arunava (7 Replies)
Discussion started by: arunava_maity
7 Replies
Login or Register to Ask a Question