Autoshutdown in Solaris

Hi

I want to make a auto shutdown program which will shutdown my sun solaris machine automatically after two days.

Please help me out in this. I dont have a GUI. Want to do it through command prompt.

Regards
Guru

Never used it, but see if you can use a at job for this

We don't know your system, or what version of Solaris you have, or what Shell you (or your cron) uses.
Please post what you normally type when you shut your system down.

hi

I am using BASH. I used to do halt for shutdown manually.

Machine: Solaris v250, OS: Solaris 10

Regards
Guru

Don't use halt but "init 5", as the former doesn't properly stop services. To shutdown your machine after two days, simply run this command as root:

echo init 5 | at now +2 days 

If you want this to be down two days after each reboot, put this single line in /etc/rc3.d/S99autoshutdown

If you change your mind, use

at -r <job-id>

to remove the job from the scheduled one.

Shouldn't that be

echo init 5 | at now +2 days

??
[/COLOR][/COLOR]

1 Like

Definitely ... :o
Reply corrected.