[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mdadm and fsck



Andrew McGlashan wrote:
You might also find the attached script useful, I place it in /etc/profile.d/ and it runs when I login.

You might want this other file too, it defines the system binary locations (and more) as used in the other script... ;-)

A.
# Global Variables

EDITOR=/usr/bin/vim
LBIN=/usr/local/bin
LS_OPTIONS='--color=auto'
PSTREE_OPT="-aG"
SCREEN_ROOT_FFP=/tmp/screens/S-root/
SCREEN_ROOT=/var/run/screen/S-root/
TRICKLE_OPT="-s -d 200"


# System Binaries

ADDUSER="$LBIN/../sbin/adduser"
APACHE2CTL=/usr/sbin/apache2ctl
APT_CACHE=/usr/bin/apt-cache
APTITUDE=$LBIN/aptitude
AWK=/usr/bin/awk
BASENAME=/usr/bin/basename
CAT=/bin/cat
CUT=/usr/bin/cut
DATE=/bin/date
DPKG_QUERY=/usr/bin/dpkg-query
DPKG=/usr/bin/dpkg
DU=/usr/bin/du
FIND=/usr/bin/find
GREP=/bin/grep
HDPARM=/sbin/hdparm
ID=/usr/bin/id
LS=/bin/ls
MD5SUM=/usr/bin/md5sum
MDADM=/sbin/mdadm
MV=/bin/mv
PS=/bin/ps
PSTREE=/usr/bin/pstree
SCREEN=/usr/bin/screen
SORT=/usr/bin/sort
TAIL=/usr/bin/tail
TRICKLE=/usr/bin/trickle
VIM=/usr/bin/vim
WC=/usr/bin/wc
W=/usr/bin/w
XARGS=/usr/bin/xargs


# Functions

function today
{
	uptime_seconds=$($CAT /proc/uptime|$CUT -f1 -d'.')
	boottime=$($DATE --date="-$uptime_seconds seconds")

	echo -e "Date/Time Now:\t$($DATE +"%A, %B %-d, %Y")\t\t[$($DATE)]\n Last boot:\t$boottime"
}

function home_space
{
	format="%8s%10s%10s   %-s\n"
	printf "$format" "Dirs" "Files" "Space" "Directory"
	printf "$format" "----" "-----" "-----" "---------"
	if [ $($ID -u) = "0" ]; then
		dir_list="/home/*"
	else
		dir_list=$HOME
	fi
	for home_dir in $dir_list; do
		total_dirs=$($FIND $home_dir -type d | $WC -l)
		total_files=$($FIND $home_dir -type f | $WC -l)
		total_blocks=$($DU -sh $home_dir)
		printf "$format" $total_dirs $total_files $total_blocks
	done
}

# Aliases

alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../..'
alias cb="$LBIN/chk-blacklisted.sh"
alias cf="$LBIN/check-frozen.sh"
alias l="$LS -alrt $LS_OPTIONS"
alias vi="$VIM"
alias adduser="$LBIN/../sbin/adduser"


Reply to: