on AIX
leave /usr alone ALL commands and libraries are in it!!
Usually an application written for UNIX will spool to /tmp or /var but not /usr so it should not increase even if it is almost full unless you install some software.
Here some help from mt notes on AIX
#!/usr/bin/ksh
#script to clean up but keep /var log files
#
# error report clean up and log retention
/usr/bin/errpt -a >> /tmp/errpt_a.old
gzip /tmp/errpt_a.old
/usr/lib/errstop
/usr/bin/rm /var/adm/ras/errlog
/usr/lib/errdemon &
/usr/bin/mv /tmp/errpt_a.old.gz /var/adm/ras/errpt_a.old.gz
#
#remove vi's temp buffer files
/usr/bin/rm /var/preserve/*
#wtmp clean-up
/usr/bin/cp /var/adm/wtmp /tmp/wtmp
gzip /tmp/wtmp
/usr/bin/cp /dev/null /var/adm/wtmp
/usr/bin/mv /tmp/wtmp.gz /var/adm/wtmp
#
#clean-up sudo.log and maintain history
#
#
/usr/bin/stopsrc -s syslogd
/usr/bin/cp /var/log/sudo.log /tmp/sudo.log
gzip /tmp/sudo.log
/usr/bin/mv /tmp/sudo.log.gz /var/log/sudo.log.gz
/usr/bin/touch /var/log/sudo.log
/usr/bin/startsrc -s syslogd
#
#If var has 100% of inodes used
#
cd /var/spool/mqueue
# find files older than 30 days in this mail queue
/usr/bin/find . -mtime +30 -ls
# remove these files
/usr/bin/find . -mtime +30 -exec rm {} \;
#
#
# find files larger than 10mg in size in /var
/usr/bin/find /var -xdev -size +20480 -ls
#note and vmcore file is a system dump and if it is more than 60 days old OR
#you have just closed a PR on that issue then you should be able to remove it
#
#
#Cleaning /home
#unless requested in a PR please do not remove files in /home unless they are yours
#increase filesystem size!!!!
#increasing 1 mg
/usr/sbin/chfs -a size=+2048 /home
#
#
#Cleaning /tmp
#First remove root owned file more than 60 days old
# to list them
/usr/bin/find /tmp -xdev -mtime +60 -user root -ls
#to remove them
/usr/bin/find /tmp -xdev -mtime +60 -user root -exec rm {} \;
#
#Otherwise, find files 10 mg or larger then contacgt user for permission to
#remove. Otherwise we must advise DPE's that we will not backup and we will remove
#any files in this directory.
#
#most usernames are the lotus notes short name;toherwise,look in the /etc/passwd to
#see who 'owns' the user.
/usr/bin/find /tmp -xdev -size +20480 -ls
#
#
#when / is full, first look for a large file
#
/usr/bin/find / -xdev -size +20480 -ls |sort -r +6
#this will find files over 10 mg and sort them in reverse order with the
#largest files first
#If you find a core file -- check the error log to see what application created
#it. Then contact user to see where they want it placed (or remove it)
who /etc/security/failedlogin
The condition of TTYs respawning too rapidly will create failed login entries. To clear the file after reading or saving the output, execute the following command:
cp /dev/null /etc/security/failedlogin
Also, look in /dev
their shold be an rmt0 (if you have a tape drive)
when some people run back-ups they do a rmto where the last character is alpha but should be numeric
if alpha is done then the back-up goes to a file in /dev called rmto not a tape drive. the file can get quite large.
Hope that this helps