You are on page 1of 3

TechTip: AIX Habits to Embrace and Others to Use with Caution | Prog... http://www.mcpressonline.com/programming/techtip-aix-habits-to-emb...

HOME PUBLICATIONS NEWS BUYER'S GUIDE EVENTS FORUMS VIDEOS POPULAR ARCHIVE BOOKSTORE
Remember me Forgot
FOLLOW US
login? | Register

Analysis App Software Career Case Studies Database Internet Networking Op Systems Product Reviews Programming Security System Admin TechTips

TechTip: AIX Habits to Embrace and Others to Use with Caution


Tips & Techniques - Programming
Written by David Tansley
Friday, 12 April 2013 01:00

0 Comments

We all get into routine habits in our jobs. But does that mean we're doing things the best
way? Support MC Press - Visit Our Sponsors

Over many years of administrating AIX systems, I developed some good and some not-so-good
habits. I have managed to get rid of my bad habits. In this article, I will share with you from my own
experience what habits I now avoid and what habits I embrace, or to put it another way, good habits
to have.

The Good

Let's first look at the good habits that I recommend.

Smit
When learning AIX, I encourage you to use smit to perform your admin tasks. Why? Because smit
will generate logs of the commands executed. This is good for two reasons:

It enables you review and thus learn the syntax of the command(s) being executed is. Even
if you're a seasoned AIX admin, it's good to review and keep up to date on command
usage.
It provides an audit log of commands executed via smit so you can review what commands
were carried out in the past that may have had an adverse effect on a running AIX system.
Forums Sponsor

Man Pages
Read those man pages if you aren't familiar with a command you're about to execute. AIX
provides excellent man page content with plenty of examples. This is another good source of
learning AIX.
POPULAR FORUMS

Test, Test, Test


Forums
Before applying any change that might affect a running system, always test on a development/test
machine first. If you get it wrong, learn from it and do it again. When you get it right, then do it on a
production box. Implementing a change that makes AIX unusable on a production machine means
end users probably won't be able to work and you're losing money for your business. It's that
simple.

Bosboot Before Every Reboot


When you need to reboot your system, perhaps for a scheduled outage or after a system
upgrade, always do a manual bosboot, even if an AIX upgrade does it for you during the upgrade
process. You need to make sure you have a bootable kernel image you can boot up on so that if
the bosboot fails, you can fix it. If you do a reboot and the boot image is corrupt, be prepared at
least to re-create the image, at worst a full system recovery. Also check that your bootlist is correct
for your devices prior to a reboot. Are you booting off in the correct order of devices? Use the
following to check this:

bootlist -m normal -o

Check Your Space Requirements Before an Upgrade Search Sponsor


When performing an AX upgrade, it's best to first do it in preview mode. AIX will report on
estimated disk usage required. Note that this is just an estimate, so add 5% and then manually
check it for yourself to make sure you have enough disk space for the upgrade. Don't rely on AIX
being right all the time. If there's not enough space partway through an upgrade, the upgrade fails
and can be messy to sort out.
POPULAR SEARCHES
The Bad
Search
Let's now look at bad habits. Caution is advised with these!

Commands That Expand in the Shell


When removing files or changing ownerships on a system, especially if it is to travel down a file
system tree, you can use the recursive optionthat is, -R. It can sometimes be a time-savings to
use the asterisk (*) command, for example:

rm -R *

1 de 3 14/09/2016 11:38
TechTip: AIX Habits to Embrace and Others to Use with Caution | Prog... http://www.mcpressonline.com/programming/techtip-aix-habits-to-emb...

chmod <owner> -R *

Hmmm. The asterisk (*) will expand when executed in the shell, and the results will not be what you
expect, as it will start from the top of the file system tree you are working on. So always quote an
asterisk ('*').

Crony Gone Wrong


Let's look at editing a crontab file, for example:

crontab -e

Notice the next key along on the keyboard is the r, which in the crontab work means to remove the
current crontab file. Oops.

When editing, be sure to hit the e (edit) key to go into edit mode or the crontab entries. If you hit
the r (remove) key on the keyboard, it will remove all your crontab entries. Ouch! In fact, why not do
a backup first? All you need to do is redirect a listing on crontab to a file, like so:

crontab -l > <backup_filename>

When inserting a one-time event into crontab (such as an overnight reboot or the stopping of a
service), be sure to remove it or comment it out after the event at the earliest opportunity. If you
don't, it will come back to haunt you by executing the command again when the date schedule has
been satisfied, like a year later!

Copy and Paste with Caution


When you have a lot of commands to runsay, to accomplish a certain taskit can be easier to
copy and paste all those commands sequentially into a notepad. You then simply copy and paste
these onto the command line to be executed. Now here it comes. If those commands contain a
line feed/carriage return, the command will be executed as soon as you paste it. If you're not in the
correct directory for these commands to be executed, you are not going to be popular. So always
check that, when you a do a copy/paste, the commands do not have a hidden control character at the end of the command.

Be Good

Those are some of the good and not-so-good habits I picked up over the years. The bad habits have taught me to check, check, and check again before committing
those commands.

About the Author:

David Tansley has over 10 years experience as a pSeries AIX administrator. When not working, he enjoys playing badminton and
watching Formula 1. But his favorite social activity is touring on his GSA motorbike with his wife and fellow riders.
David Tansley Read More >>

Articles by this Author:


TechTip: Monitoring AIX with SNMP
TechTip: Excluding Files Using GNUtar or AIX tar
TechTip: AIX Online Backups with Splitcopy
TechTip: Mksysb: Your AIX System Backup
TechTip: Locate and Get Information About AIX Files

View all articles by this author

2 de 3 14/09/2016 11:38
TechTip: AIX Habits to Embrace and Others to Use with Caution | Prog... http://www.mcpressonline.com/programming/techtip-aix-habits-to-emb...

0 Comments MC Press Online 1 Login



Recommend Sort by Newest
Share

Start the discussion

MC PRESS ONLINE

RPG Academy: Write Better Code Naming Variables Open Source on IBM i Gets Hot Hot Hot | Analysis of
Guidelines, Part 1 | RPG News Events

Thanks, Rafael! I'm also a BIG fan of prefixes (for What did I miss? Community, please add
Everything!) Just a different preference: Underscores are a minor additional points, links, conversations.
pain to type, take up valuable horizontal space (ie,

Budget Dollars Can Be Skin Deep | Commentary Practical RPG: Managing Copy Files | RPG

"Until the user experience has been modernized, Joe, excellent article and overall a good
then they'll always think that the technology is second-rate." - explanation.Just for a different perspective, I use a slightly
Well said, and absolutely true! different technique with my copy members. At the top of

Subscribe d Add Disqus to your site Add Disqus Add Privacy

back to top

< Prev Next >


Last Updated on Friday, 12 April 2013 01:00

User Rating: /0
Poor Best

Related Articles:

09/09/2016 - TechTip: Edit Files in the IFS


06/20/2014 - TechTip: More GridX Features
02/14/2014 - TechTip: Excluding Files Using GNUtar or AIX tar
07/31/1993 - TechTalk: Recursive Calls

MC-STORE.COM

Home | Publications | News | Events | Buyer's Guide | Forums | Videos | Popular | Archive | Bookstore
Copyright 2016 MC Press Online, LLC | Privacy Policy | Search | RSS | FAQ | Contact Us | Write For Us | Advertise | Site Map

3 de 3 14/09/2016 11:38

You might also like