Showing posts with label aix. Show all posts
Showing posts with label aix. Show all posts

20100429

AIX backup / restore

The commonly used mode of backup utility back up file systems by i-node. It uses the Level param of 0 - for full,
1 to 9 for incremental backups, and takes the predefined fileset as input (/, /home, /opt, /usr, /var, etc.).
If you want to use the ordinary directory, not the one of predefined filesets use the -i switch.
It takes the list of files from the standard input (back up by name), and when used in conjunction with hyphen sign
as the target device, it can be piped directly to dd, to put the output into the file.

$ find /etc | backup -i -f - | dd of=/backup/etc.bak

To list the content of backup archive use restore with the -T switch.

$ restore -Tq -f /backup/etc.bak

To restore the individually named file use -x switch.

# restore -xqf /backup/etc.bak /etc/passwd
x /etc/passwd

...or files (in verbose mode):

# restore -xqvf /backup/etc.bak /etc/passwd /etc/security/passwd
New volume on /backup/etc.bak:
Cluster 51200 bytes (100 blocks).
Volume number 1
Date of backup: Thu Apr 29 12:22:13 2010
Files backed up by name
User root
x 560 /etc/passwd
x 288 /etc/security/passwd
total size: 848
files restored: 2

And to get back all the content of the specified subdirectory use the force of -d

# restore -xqdf /backup/etc.bak /etc/security
x /etc/security
x /etc/security/.idlck
x /etc/security/.ids
x /etc/security/.kst
x /etc/security/.profile
x /etc/security/acl
x /etc/security/aixpert
x /etc/security/aixpert/bin
x /etc/security/aixpert/bin/ISSServerSensor
x /etc/security/aixpert/bin/audit_report
x /etc/security/aixpert/bin/binaudit
[...]


Be aware that all the above actions has overwritten the original files.

20091208

AIX stat equivalent


$ istat /usr/sbin/lsuser
Inode 115447 on device 10/5 File
Protection: r-xr-xr-x Set UID
Owner: 0(root) Group: 7(security)
Link count: 1 Length 84080 bytes

Last updated: Tue Dec 8 14:40:33 CST 2009
Last modified: Mon Mar 30 00:45:51 CDT 2009
Last accessed: Tue Dec 8 16:55:55 CST 2009


* lsuser hint
To display the attributes of all the users, use the ALL keyword:

$ lsuser ALL

20090514

AIX software (de)installation

During my AIX lab works I've accidentally installed all the packages from the /export/aix/lpp_source/xlCv8eval location
(IBM XL C/C++ V8.0 Evaluation).

aix61 [/export/aix]# installp -a -d lpp_source/xlCv8eval all
[...]

+-----------------------------------------------------------------------------+
BUILDDATE Verification ...
+-----------------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS
------------------
221 Selected to be installed, of which:
66 Passed pre-installation verification
146 FAILED pre-installation verification
9 Already installed (directly or via superseding filesets)
----
66 Total to be installed

+-----------------------------------------------------------------------------+
Installing Software...
+-----------------------------------------------------------------------------+

[...]

Finished processing all filesets. (Total time: 2 mins 17 secs).

[...]

Two minutes and seventeen seconds of sorrow.

Because it was my first installation attempt I wanted to rollback the applied changes.
But, how to uninstall all the filesets together?
I've prepared the handy oneliner. Feel free to provide a better solution.

aix61 [/export/aix/lpp_source/xlCv8eval/installp]# for f in `ls -1 ppc | cut -d . -f 1 | sort | uniq`; \
do installp -u -e /home/wisnios/xlCv8eval.uninstall.log -g $f; \
done

where ls -1 ppc | cut -d . -f 1 | sort | uniq gives:

ibmdebugger
memdbg
vac
vacpp
xlC
xlhelp
xlmass
xlsmp

Mission accomplished.

20090313

Linux stuff in the AIX neighbourhood

When I logged in into the AIX system for a very first time I had experienced the beauty of IBM system, and helplessness. I had known only the four AIX specific commands, and a bunch of experiences from Sun Solaris system.

The first stonghold was the ksh system shell. No history. No command completion. "No" in a way I used to use it. It took me a while to find out the fc cmd.
So, the fist thought was to bring in the zsh.

But... in order to make it possible, I have to know - HOW and FROM.
The Solaris has got it's sunfreeware.com and blastwave.org. AIX - rpm database of ppc packages.

Here it is: http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
How to get the rpm itself: http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/altlic.html

The rest is as simple as:

# rpm -i zsh*rpm

... after installing the dependencies ;-) (rpm packages: coreutils, grep)