tar -tvf filename.tar
Showing posts with label aix. Show all posts
Showing posts with label aix. Show all posts
Wednesday, March 30, 2011
Wednesday, April 28, 2010
Change core file path for IBM HTTP Server 2.0.47
To change the default path where the core file is dumped for IBM HTTP Server 2.0.47 on AIX
1- Go to IBM HTTP server conf directory (ex: /usr/IBMIHS/conf)
2- Open httpd.conf
3- Edit the "CoreDumpDirectory" to the required directory (ex: CoreDumpDirectory "/usr/IBMIHS/corefiles")
1- Go to IBM HTTP server conf directory (ex: /usr/IBMIHS/conf)
2- Open httpd.conf
3- Edit the "CoreDumpDirectory" to the required directory (ex: CoreDumpDirectory "/usr/IBMIHS/corefiles")
Kill signal to dump core file
To kill a process and make it dump a core file, use the "6" signal
kill -6 PID
kill -6 PID
How to enable full core on AIX
1- To obtain full core files on AIX, set the following ulimit options:
ulimit -c unlimited turn on corefiles with unlimited size
ulimit -n unlimited allows an unlimited number of open file
descriptors
ulimit -d unlimited sets the user data limit to unlimited
ulimit -f unlimited sets the file limit to unlimited
You can display the current ulimit settings with:
ulimit -a
2- Set the following in smitty:
1. Start smitty as root
2. Go to System Environments -> Change/Show Characteristics of Operating System
3. Set the Enable full CORE dump option to TRUE
Alternatively, you can run chdev -l sys0 -a fullcore='true' as root.
You can check the setting with lsattr -D -c sys -a fullcore -H, which should produce output similar to this:
attribute deflt description user_settable
fullcore false Enable full CORE dump True
Reference: IBM Web Site, AIX Help
ulimit -c unlimited turn on corefiles with unlimited size
ulimit -n unlimited allows an unlimited number of open file
descriptors
ulimit -d unlimited sets the user data limit to unlimited
ulimit -f unlimited sets the file limit to unlimited
You can display the current ulimit settings with:
ulimit -a
2- Set the following in smitty:
1. Start smitty as root
2. Go to System Environments -> Change/Show Characteristics of Operating System
3. Set the Enable full CORE dump option to TRUE
Alternatively, you can run chdev -l sys0 -a fullcore='true' as root.
You can check the setting with lsattr -D -c sys -a fullcore -H, which should produce output similar to this:
attribute deflt description user_settable
fullcore false Enable full CORE dump True
Reference: IBM Web Site, AIX Help
Sunday, April 18, 2010
Add a job to crontab that runs every minute on AIX
- crontab -e
- 0-59 * * * * hobba
crontab -e: opens a text file (via vi) to add your job
0-59: is to run every minute
hobba: is the command to run, it's either a Unix command or a script
Monday, March 15, 2010
Extract a certain file to a certain directory from a tar archive using GNU Tar
"gtar -C hobba -xvf aamr.tar aamr/1"
where:
"hobba" is the directory to extract to
"aamr.tar" is the archive from which we'll extract the file
"aamr/1" is the file inside the archive to be extracted to the destination directory (hobba).
where:
"hobba" is the directory to extract to
"aamr.tar" is the archive from which we'll extract the file
"aamr/1" is the file inside the archive to be extracted to the destination directory (hobba).
A more convenient alternative to AIX tar; gtar
Searched everywhere just to know how to use the "tar" command to extract an archive to a certain folder instead of extracting it using the same directory structure inside, and so here are the steps:
- Don't use the "tar" program
- Download the GNU tar rpm from the AIX toolbox
- Install it "rpm -ivh blablabla.rpm", you must have installed rpm at first from there of course, note that you must have root access to install that package
- logout and then back in, use "gtar" from now on.
Tuesday, February 23, 2010
How to edit scheduled jobs (crontab) on AIX
A very useful link: http://publib.boulder.ibm.com/infocenter/discover/v8r4/index.jsp?topic=/com.ibm.discovery.ds.publish.doc/c_UG_Configuring_Cron_Job.htm
Monday, December 14, 2009
How To Find and Delete Files Not Matching MULTIPLE criteria using bash in AIX
"find . ! -name "*.bz2" ! -name "ESPRD*" | xargs rm"
The above command finds all files in the "current" directory excluding those with "*.bz2" extension and those which start with "ESPRD*" and then deletes them all.
The above command finds all files in the "current" directory excluding those with "*.bz2" extension and those which start with "ESPRD*" and then deletes them all.
Wednesday, October 21, 2009
Script to monitor a Filesystem on AIX
#!/bin/sh
# This script checks if the /siebel filesystem reaches 2 GB of free space
# And then delete the old logs except those of today
warninglimit=2097152 # This number is in KB, it's equal to 2 GB,
# KB is used to avoid floating point numbers
filesystems="/siebel" # List of filesystems to be monitored, separated by
# blank spaces
for fs in $filesystems # Loop on the list of filesystems above
do
size=`df -k $fs|grep $fs|awk '{ print $3; }'` # Extract size of
# Filesystem in KB
if [ $size -le $warninglimit ] # If fs size is less than warning lim.
then
echo "WARNING: Low disk space for $fs ($size)"
# Add what to delete here
fi
done
# This script checks if the /siebel filesystem reaches 2 GB of free space
# And then delete the old logs except those of today
warninglimit=2097152 # This number is in KB, it's equal to 2 GB,
# KB is used to avoid floating point numbers
filesystems="/siebel" # List of filesystems to be monitored, separated by
# blank spaces
for fs in $filesystems # Loop on the list of filesystems above
do
size=`df -k $fs|grep $fs|awk '{ print $3; }'` # Extract size of
# Filesystem in KB
if [ $size -le $warninglimit ] # If fs size is less than warning lim.
then
echo "WARNING: Low disk space for $fs ($size)"
# Add what to delete here
fi
done
Tuesday, May 5, 2009
How to ensure the integrity of your VERY LARGE files on AIX
Something that I've learnt by time is that I must check my files - especially big ones - upon transferring them from one medium to another or through a network or you're really going to face troubles that you'll see everyday in your worst nightmares :(. Anyway, it's very simple and quite fast, there are lots of methods available and here are my favourite two:
- "csum -h MD5 file_name" #for small files, it's very fast
- If the above doesn't work, use this instead "cksum file_name" #For very large files
Labels:
aix,
cksum,
csum,
Integrity of very large files on AIX,
md5sum
Thursday, February 5, 2009
Getting X11 forwarding through ssh working after running su in AIX
After logging to a remote server using the "ssh -X user@host" (assuming that you have enabled X11Forwarding in your "/etc/ssh/sshd_config" file, and then restarted ssh by issuing "stopsrc -g ssh" and then "startsrc -g ssh"), you can run any X-windows application you want ONLY WITH THE USER YOU USED TO LOGIN FROM THE BEGINNING. Whenever you switch your user using "su - username", you won't be able to run any graphical application due to the following two problems:
To solve problem two, you'll have to do the following after login to the server:
"ssh -X root@10.11.12.117"
"xauth list" Output -> "xyosd/unix:10 MIT-MAGIC-COOKIE-1 321c1d6b5bf22484395d0e05b0a29104"
"su - ahmad"
"xauth add xyosd/unix:10 MIT-MAGIC-COOKIE-1 321c1d6b5bf22484395d0e05b0a29104"
Article Resources: "http://www.debian-administration.org/articles/494"
- The $DISPLAY variable value is lost
- X authentication is based on cookies -- secret little pieces of random data that only you and the X server know... So, you need to let the other user know what your cookie is
To solve problem two, you'll have to do the following after login to the server:
- run the command "xauth list" to request the cookie for the current DISPLAY that's connecting to your X server, you'll receive something like that: somehost.somedomain:10 mit-magic-cookie-1 4d22408a71a55b41ccd1657d377923ae
- Switch to the other user by issuing "su - username"
- Copy the above response and paste it to produce this command "xauth add somehost.somedomain:10 mit-magic-cookie-1 4d22408a71a55b41ccd1657d377923ae"
- Important Note: You'll have to repeat the above steps every time you use ssh to login to a server.
"ssh -X root@10.11.12.117"
"xauth list" Output -> "xyosd/unix:10 MIT-MAGIC-COOKIE-1 321c1d6b5bf22484395d0e05b0a29104"
"su - ahmad"
"xauth add xyosd/unix:10 MIT-MAGIC-COOKIE-1 321c1d6b5bf22484395d0e05b0a29104"
Article Resources: "http://www.debian-administration.org/articles/494"
Monday, December 15, 2008
How to increase AIX swap space
"lsps -a"
This will display something like:
Page Space Physical Volume Volume Group Size %Used Active Auto Type
hd6 hdisk0 rootvg 512MB 1 yes yes lv
This means that hd6 is the logical volume used for paging. To increase it, use the following command:
"extendlv hd6 10G"
This will add 10G of space to hd6, now reboot and then re-run "lsps -a" or you can simply use the "topas" command to check the paging space available.
This will display something like:
Page Space Physical Volume Volume Group Size %Used Active Auto Type
hd6 hdisk0 rootvg 512MB 1 yes yes lv
This means that hd6 is the logical volume used for paging. To increase it, use the following command:
"extendlv hd6 10G"
This will add 10G of space to hd6, now reboot and then re-run "lsps -a" or you can simply use the "topas" command to check the paging space available.
Saturday, December 6, 2008
How to solve the error: 452 Error writing file: A file cannot be larger than the value set by ulimit
When trying to transfer a very big file (over ftp for example), you'll receive the error above, this limit is a security limit in AIX and you can solve it by simply editing the /etc/security/limits file and increasing the "fsize" limit or simply changing it to "-1" to be unlimited, and then retry your transfer, you don't have to restart the machine for changes to take effect.
Ubuntu Connect to AIX V5.3 XServer
How to redirect graphical output of AIX to Ubuntu and run:
1) Go to System ->Administration ->Login Window->Security-> untick "Deny TCP connections to Xserver"
2) Log out and then back in
3) Type these commands in the terminal:
xhost +
telnet host_name
export DISPLAY=Client_IP:0.0
4) Run whatever x-application you need :)
1) Go to System ->Administration ->Login Window->Security-> untick "Deny TCP connections to Xserver"
2) Log out and then back in
3) Type these commands in the terminal:
xhost +
telnet host_name
export DISPLAY=Client_IP:0.0
4) Run whatever x-application you need :)
Subscribe to:
Posts (Atom)