Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron job to reboot 1

Status
Not open for further replies.

bjzielinski

IS-IT--Management
Nov 8, 2001
93
US
I know we shouldn't have to do this so much, but for some reason the software vendor recommends a weekly reboot of our AIX 4.3 machine, probably because they have a leak of some sort and aren't smart enough to fix it. Anyhow, this is done manually which is a major pain. If I want to schedule this in a crontab to run at 3:00am every Saturday morning, please let me know if the following is correct/workable.

crontab -e

0 3 * * 6 shutdown -r now

Save file in vi (however that is done).

Bill Zielinski
County of Midland, Michigan
 
Here is my entry...

0 5 * * 0 /usr/sbin/shutdown -Fr > /tmp/shtdown.dat # auto shutdown

The only difference is the day and time. If I were you, I'd specify the full path to "shutdown".

Other than that - yours looks OK.

Bill.
 
Bills option looks perfectly OK to me. You asked about how to save the file - after making the entry, type a colon and then wq! to quit and write the file away. The chages will take effect immediately. You'll probably need to be root (or have root access) to shutdown with this command. Good luck.
 
I would like to point out to using the `reboot` command that was mentioned. From the man page for reboot:

The reboot command can be used to perform a reboot operation if no other users are logged into the system. The shutdown command is used when the system is running and multiple users are logged into the system.

I would stick to shutdown, and use the full path for security reasons.
 
This system won't be around a whole lot longer as the department using it is looking at alternative vendors, so I really don't want to get very involved, just want to bear with it a bit longer until it's given the heave-ho. Thanks for clarifying and the vi commands. Bill Zielinski
bzielinski@co.midland.mi.us
County of Midland, Michigan
 
This anonymous vendor also claims that shutdown -r is not what they recommend, they recommend a full system halt, turn off, and turn back on. I say their full of crap and that rebooting is essentially the same thing other than components don't lose power, but since we aren't adding any additional hardware or anything of the sort, that shouldn't matter. Does the filesystem know the difference? Does something not go away? Should these guys go back to school to figure out their memory leak in the first place? Bill Zielinski
bzielinski@co.midland.mi.us
County of Midland, Michigan
 
Bill,

Use the shutdown -Fr command. This shuts the system down immediately (that's what the -F is for) and brings the system back up after it is shutdown (that's the -r). On some Unix platforms, there is a subtle difference between shutdown and reboot. I don't think that is the case with AIX, but shutdown -Fr will accomplish the same thing as reboot.

I can't see what the difference is between shutting down followed by bringing the system back up again immediately and shutting down and turning it off. (On some systems, you have to literally unplug the thing to cut the power.) The system's memory isn't going to know if you unplugged it or not. Once it's shut down, the memory is cleared. Maybe someone else knows something you and I don't, however.

Yes, these guys should go back to school to fix their memory leak and learn more about AIX. I had a similar experience a few years ago when the vendor told us we had to boot the system every week, but, of course, they didn't say it was to fix a memory leak (but everyone knew that's where they were coming from). My boss had a background with hospitals and pointed out that those hospital systems couldn't be booted for medical reasons so he couldn't understand the reason for weekly boots. Our Unix sys admin guru told the head programmer (in a rather brutal fashion, but it worked) to fix his program because the most we would boot the box would be monthly (and then only reluctantly). The vendor fixed the program.

I'd ask your vendor what Unix platform their app was designed on, too. If it was programmed on some obscure Unix platform and then ported to AIX, their porting it to AIX might have introduced some memory leaks and they don't know how to fix it on the AIX platform. Ask them how much AIX experience they have had and how many AIX installations they have put in.

I think you should get a new vendor!

Good luck. Let us know how it turns out!
 
I always thought the main issue with rebooting was to clear the paging space due to the inability of pre-AIX 5 releases to free up stale pages.

In our case is certainly seemed so, paging space creeps up during the week from around 10% to around 50%. Once it goes over 50% the system becomes unstable for some or other unknown reason, and does crazy things like hanging in the reboot. But then I must admit, our 43P systems are way outdated, RAM is maxed at 128MB with an average of 180MB processes running as daemons, so paging is major at times. IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top