A quick regex to grep for blank lines in a text document
cat test.txt |egrep -v '^( | )*$'
The trick is to invoke 'visual mode' when entering the command - right after the second 'pipe' character press Ctrl-v Ctrl-i to place a tab control character in the text - You could also grep for return characters with ctrl-v ctrl-m.
In plain english following egrep:
-v = skip lines matching the pattern
the pattern is in single quotes
^ = the beginning of the line
( | ) = either a space or a tab character - see note above.
* = matches the previous character zero or more times
1. We see the following message in errpt
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
26623394 1217085709 T H fscsi0 COMMUNICATION PROTOCOL ERROR
4B436A3D 1217085709 T H fscsi0 LINK ERROR
26623394 1217085709 T H fscsi0 COMMUNICATION PROTOCOL ERROR
4B436A3D 1217085709 T H fscsi0 LINK ERROR
26623394 1217085709 T H fscsi0 COMMUNICATION PROTOCOL ERROR
4B436A3D 1217085709 T H fscsi0 LINK ERROR
26623394 1217085709 T H fscsi0 COMMUNICATION PROTOCOL ERROR
4B436A3D 1217085709 T H fscsi0 LINK ERROR
Last week I scheduled a 2 hour downtime to remount some large JFS2 file systems. When I inherited this server a year ago most of the data was contained in a few 32TB JFS2 filesystems. Fearing a week long fsck looming, I began breaking these in to smaller, more manageable chunks of no more than 6TB each.
When my downtime began I unmounted my filesystems, and issued the mount commands to make them available again. As luck would have it, all 3 needed to be fscked before they would mount.
I spent a little over an hour this morning sorting our an error in a Nagios
module for monitoring lexmark printers.
This perl module would throw the error:
Undefined subroutine &SNMP::initMib called at ...
It seems I was foolishly confusing the module "SNMP.pm" packaged in perl-Net-SNMP-5.2.0-1.el5.1 with the "SNMP.pm" packaged in net-snmp-perl. As it turns out, 'Net-SNMP' and 'Net-SNMP' are completely unrelated software projects.
Performing an install or update from an attached DVD drive is often the simplest way to patch or install a system. Finding and accessing these drives from an LPAR requires a bit of black magic. These steps should make the process a little easier.
These steps were useful on P5 frames. On the P6 frames I've used the process is similar, but the device is labeled USB.
Before the drive can be mounted, you have to deallocate it from any other LPAR which may be using it. In my case it was allocated to my vios1 LPAR when I needed it on vios2.
Calling a script at the beginning of a backup job is a fairly common task.
The convention for this when using Symantec (Veritas) Netbackup is to place your commands in a script called 'bpstart_notify', chmodding it to 555 and placing it in /usr/openv/netbackup/bin. If your script can complete in under (the default) 300 seconds you should be home-free.
That is unless your script calls anything on another computer over ssh.
I just wrapped up a 3 day full restore of Oracle and in doing so, gained a much better handle on wrangling my backup software. To important points. When restoring a backup job whose files were archived over more than 1 day, restore the job by its session object, not by using a date selection. The second important note is to restore filesystems concurrently. Another recommendation after I was finished was to select 'restore sparse files'. Now it's time for some sleep.
AIX now ships with sshd but is not configured to forward X11 by default. In addition it looks like the person who packaged OpenSSH at IBM did not have xauth in the default AIX location.
To enable X11 forwarding on AIX.
#1 Edit /etc/ssh/sshd_config and uncomment:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Then add an entry pointing to the correct xauth location.
XauthLocation /usr/bin/X11/xauth
#2 Login to your console using your HMC or with telnet - in other words NOT with ssh
Syntax of the find utility is made more complex by the need to escape some of its switches for use in a shell, but sooner or later you will run into a situation where you have too many files that need an operation for any other tool to manage.
The first time I ran into this situation was with some software that produced a log file with each event that was processed. When I noticed the file system was getting full, there were already millions of files that needed deleting. They each had a date stamp in their names but the normal way of 'wildcarding' for the oldest files:
Today I found out a single critical file was needed from one of the JFS2 filesystems I was working with the other day. I was able to recover the file and things are working again.
Following a fiber-channel card failure I was asked to help recover some corrupt JFS2 filesystems. They couldn't be fsck-ed but I was able to run fsdb to modify the filesystem meta-data. First I tried replacing their superblock structures which didn't help.