Operating System - Tru64 Unix
1748166 Members
3768 Online
108758 Solutions
New Discussion юеВ

Re: execute at startup

 
fergani
Advisor

execute at startup

Hello
I need your help.
after restarting my server is completed,
I have a batch file (script file) and I want it to be executed immediately after restarting.

But not whenever the system restarted ,the batch file executed.
I want it to execute in specific time only.

how can I do that?

tru64 Unix operating system type.
bye.
5 REPLIES 5
Steven Schweda
Honored Contributor

Re: execute at startup

> [...] I want it to be executed immediately
> after restarting.

> [...] But not whenever the system restarted
> [...]

> how can I do that?

Do _what_?

Decide what you want, then ask again?

man cron
man rc0
man rc2
man rc3
man rc4

> tru64 Unix operating system type.

sizer -v
fergani
Advisor

Re: execute at startup

Hello
the operating system I am using is tru64 Unix.
I have a batch file (script file)containing some commands and I want them to run at startup .

how can I do that?

bye.


Steven Schweda
Honored Contributor

Re: execute at startup

> how can I do that?

Uh, learn to read?
Kapil Jha
Honored Contributor

Re: execute at startup

if you want them to start the script at some user login. then put it in /etc/profile else you can put the script in rc1, so whenever system start it would run it.

If you want to do it in some specific runlevel put in rcX, where X is run level.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Pieter 't Hart
Honored Contributor

Re: execute at startup

Hi fergani
Steven allready led you (not too clearly) to the manual (man pages, like helpfiles) for rc0 rc2 rc3. => "man rc0" (etc)
unix has a several directories for scripts that are executed during startup.
There are different startup stages like single user mode (eg maintenance mode, no user activity) and multi-user mode , therefore there are multiple such directories.
/sbin/rc0.d
/sbin/rc2.d and so on.

the highest rc is a fully operational mode
scripts needed to execute at startup start with a capital "S" followed by a number.
the system executes all S files in order. Numbers need not be sequential, there is no problem if some numbers are skipped.

so you can add a startup-script like
/sbin/rc3.d/S999-mystartupscript
(replace 999 with higher then existing highest number)

you yourself must see to it that the script is executed at a specific time (and not multiply concurrent at the same time).
You can use a variant of "at