# Script: shobiguser_bigfils # Where: in $FEDIR/scripts where $FEDIR=/apps/nns_com/fea # # Purpose: # 1. Gets the disk usage (in 1K blocks) of directory name that is # passed in var $1. (du -ks) # 2. If size is greater than HOMSIZCUT, # gets the names of the largest files & directories (> FILSIZCUT) # ... for display in a pop-up window. # 3. Pops up a window with the size-sorted file/subdirectory list shown, # along with advice on how to (re)move the files. # # Typical Call Format: $FEDIR/scripts/shobiguser_bigfils $HOME & # # Called by: feautils.menu/fileman.menu script, shell, or FEA Desktop xxxxxxxx # # Written by: B. Montandon 4Jan96 # Updated by: B. Montandon 8May97 better .rhosts handling # Updated by: B. Montandon 22Sep97 chgd /proj# to /data # FOR TEST: # if test "$USER" = "ideasadm" # then # set -x # fi if test "$1" = "" then exit fi # CHKDIR=$HOME CHKDIR=$1 HOMSIZCUT=85000 # FOR TEST: # if test "$USER" = "ideasadm" # then # HOMSIZCUT=24000 # fi FILSIZCUT=500 #FILSIZCUT=1000 export CHKDIR HOMSIZCUT FILSIZCUT . $FEDIR/scripts/mak_rhosts # set -x rsh sgia "du -sk $CHKDIR > $HOME/temp.lis" # set - # FOR TEST: # if test "$USER" = "ideasadm" # then # echo " # temp.lis contains:" # cat $HOME/temp.lis # fi # . $FEDIR/scripts/mv_rhosts ## Check 1st field ($1) in record(s) of temp.lis .. and put entire line ($0) into ## variable BIG_HOME_CHK, if there is the 1st field is a number larger than HOMSIZ. # set -x BIG_HOME_CHK=`nawk -v HOMSIZ=$HOMSIZCUT '$1 > HOMSIZ { print $0 }' $HOME/temp.lis` # set - ## BIG_HOME_CHK=`awk '$1 > HOMSIZ { print $0 }' HOMSIZ=$HOMSIZCUT $HOME/temp.lis` rm $HOME/temp.lis if test "${BIG_HOME_CHK}" = "" then exit fi # .................................................... . $FEDIR/scripts/mak_rhosts PERCENT=`echo "scale = 10; ${HOMSIZCUT}/1000" | bc` PAGESDIR=`echo "scale = 10; ${HOMSIZCUT}/5" | bc` VOLSDIR=`echo "scale = 10; ${HOMSIZCUT}/2500" | bc` PAGESFIL=`echo "scale = 10; ${FILSIZCUT}/5" | bc` echo "\ ......................`date`........................... Directory $CHKDIR is bigger than ${HOMSIZCUT} Kilobytes. Note1: This is ${PERCENT}% of the 100Meg standard limit on user 'personal preference file' directories at NNS. Recall that the BUDGET-DASD limit on IBMD home directories (the userid.* files) was set at 100Meg. ${HOMSIZCUT}K is equivalent to about ${PAGESDIR} pages of text ... which is equivalent to about ${VOLSDIR} volumes of an encyclopedia. Note2: Your home directory is not a suitable place to store company project files. If you do not login for 90 days, it is C63 policy to remove your home directory. It is assumed that home directory files left untouched for that long are disposable, 'personal preference' files. If your group needs a change in that policy, contact management of C63 Telecommunications/OperatingSystemsSupport. Note3: FEA Users: If you need a USERID sub-directory of a /data//cae directory in which to store various project files OTHER THAN I-DEAS model, part, assembly, and drawing files (for example, ABAQUS and NASTRAN input), contact the I-DEAS Administration group in E40. CADD Users: If your group needs a USERID directory similar to that being afforded to FEA users ... or some sort of archival mechanism, contact E40 Engineering management to present a case for the former ... or to specify requirements for a design for the latter. ............................................................................ Large (>${FILSIZCUT}K) Sub-Directories and Files in $CHKDIR : Note: ${FILSIZCUT}K is equivalent to about ${PAGESFIL} pages of text. Kilobytes Large Directories & Files --------- --------------------------------------- " > $HOME/temp.lis # set -x rsh sgia du -ka $CHKDIR | sort -n -r > $HOME/temp.sortlis # set - # . $FEDIR/scripts/mv_rhosts # set -x nawk -v FILSIZ=$FILSIZCUT '$1 > FILSIZ { print $0 }' $HOME/temp.sortlis >> $HOME/temp.lis # set - # # awk '$1 > FILSIZ { print $0 }' FILSIZ=$FILSIZCUT $HOME/temp.sortlis >> $HOME/temp.lis rm $HOME/temp.sortlis echo " Please delete or move or compress any (large) files that you can. If possible, move (large) short-term,usem-and-deletem files to /local/scratch. Files that need to be kept for weeks, months, or years, should be moved to a 'project' directory ... like /data//cae/ or /data//ideas/team/datamgmt# You can use 'u f ud' to see size-sorted sub-directories of your home directory. You can use 'u f uf' to see size-sorted files in those sub-directories. See FEA/MCADD menu options 'u f cl' 'u f rc' 'u f cm' for some utilities to periodically delete/move/compress files. When you quit this listing with 'q', you will be prompted whether to print it. If there are many potentially (re)movable files, you may find it handy to print this listing for reference. " >> $HOME/temp.lis FEDIR=/apps/nns_com/fea export FEDIR # xwsh -bg midnightblue -fg white \ xwsh -bg blue4 -fg white \ -title "shoBIGUSERbigHOMEfils" -name "shoBIGUSERbigHOMEfils" \ -fn Screen15 \ -geometry 80x34+010+330 \ -e $FEDIR/scripts/shofil $HOME/temp.lis & # -hold -iconic \ # -fn $WINFONT \ # -geometry 65x56+010+010 \