Skip to content
Snippets Groups Projects
Commit 38310b4e authored by Mac Newbold's avatar Mac Newbold
Browse files

Add new script to notify users when they are over their quota. Runs from

cron daily, on the fs node (ops) as root. Uses lots of configure variables
so that it does the right thing in any installation, without any
customization.

One possible caveat regarding quotas: If FS_NODE != USERNODE, they don't
have a login on the fs machine. So checking their quota won't work unless
the rpc.rquotad(8) daemon is running on FS_NODE, which we currently don't
do.

In order to do this right, I had to add a new configure var,
FS_WITH_QUOTAS, that has a space separated list of file systems that have
quotas enabled. (Ie the default is 'FS_WITH_QUOTAS="/q /users"'.) It
doesn't have any default, since I couldn't come up with a reasonable one.
All the defs files have been updated appropriately to define this new
variable.
parent fe3fde01
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# Found on the internet, and customized for Emulab
#
# This script must run as root on ops, and should be run from cron daily,
# with an entry in /etc/crontab (on ops) something like this:
#
# 0 6 * * * root /usr/testbed/sbin/quotamail
#
# Some sites may wish to change the CC to a different list, or
# possibly even remove it all together.
#
# One possible caveat regarding quotas: If FS_NODE != USERNODE, they don't
# have a login on the fs machine. So checking their quota won't work unless
# the rpc.rquotad(8) daemon is running on FS_NODE, which we currently don't
# do.
#
for i in `/usr/sbin/repquota -v @FS_WITH_QUOTAS@ | awk '$2 ~ /+/ {print $1}'`
do
(
# feel free to change this message!!!
cat << MESSAGE
From: Testbed Operations <@TBOPSEMAIL_NOSLASH@>
To: $i@@OURDOMAIN@
Cc: Testbed Operations <@TBOPSEMAIL_NOSLASH@>
Subject: over disk quota at @THISHOMEBASE@
Hello,
It looks like your disk usage has exceeded your disk quota. Please move or
remove some files to get below your quota. Disk space is limited, so if
you could clean up your directory it would be appreciated.
You can check your usage with the 'quota' command on @USERNODE@:
> quota -v -l
`quota -v -l $i`
The directory trees where you most likely have files are:
Project directory: @FSDIR_PROJ@
Group directory: @FSDIR_GROUPS@
User/Home directory: @FSDIR_USERS@
Thanks,
@THISHOMEBASE@ Testbed Operations
@TBOPSEMAIL_NOSLASH@
MESSAGE
) | /usr/sbin/sendmail -t
done
......@@ -861,6 +861,7 @@ fi
#
......@@ -1270,7 +1271,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1274: checking for a BSD compatible install" >&5
echo "configure:1275: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -1353,6 +1354,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
account/GNUmakefile account/tbacct account/webtbacct \
account/addpubkey account/webaddpubkey \
account/addsfskey account/webaddsfskey \
account/quotamail \
tbsetup/GNUmakefile tbsetup/console_setup tbsetup/spewlogfile \
tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
tbsetup/os_load tbsetup/os_setup tbsetup/os_select tbsetup/power \
......@@ -1571,6 +1573,7 @@ s%@OURDOMAIN@%$OURDOMAIN%g
s%@FSDIR_PROJ@%$FSDIR_PROJ%g
s%@FSDIR_GROUPS@%$FSDIR_GROUPS%g
s%@FSDIR_USERS@%$FSDIR_USERS%g
s%@FS_WITH_QUOTAS@%$FS_WITH_QUOTAS%g
s%@TRACK_INTERSWITCH_BANDWIDTH@%$TRACK_INTERSWITCH_BANDWIDTH%g
s%@TIMESTAMPS@%$TIMESTAMPS%g
s%@UNIFIED_BOSS_AND_OPS@%$UNIFIED_BOSS_AND_OPS%g
......
......@@ -31,6 +31,7 @@ AC_SUBST(OURDOMAIN)
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
AC_SUBST(FS_WITH_QUOTAS)
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
AC_SUBST(TIMESTAMPS)
AC_SUBST(UNIFIED_BOSS_AND_OPS)
......@@ -396,6 +397,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
account/GNUmakefile account/tbacct account/webtbacct \
account/addpubkey account/webaddpubkey \
account/addsfskey account/webaddsfskey \
account/quotamail \
tbsetup/GNUmakefile tbsetup/console_setup tbsetup/spewlogfile \
tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
tbsetup/os_load tbsetup/os_setup tbsetup/os_select tbsetup/power \
......
......@@ -20,3 +20,4 @@ TBSTATEDEMAIL=barb@cs.utah.edu
TBTESTSUITEEMAIL=barb@cs.utah.edu
WWWHOST=www.emulab.net
WWW=www.emulab.net/~barb/www
FS_WITH_QUOTAS="/q /users"
......@@ -25,3 +25,4 @@ WWWHOST=www.mini.emulab.net
WWW=www.mini.emulab.net/~barb/www
TBCOOKIESUFFIX=-mini
THISHOMEBASE=Mini.Emulab.Net
FS_WITH_QUOTAS="/z"
......@@ -23,3 +23,4 @@ TBSTATEDEMAIL=calfeld@flux.cs.utah.edu
TBTESTSUITEEMAIL=calfeld@flux.cs.utah.edu
WWWHOST=www.emulab.net
THISHOMEBASE=Emulab.Net
FS_WITH_QUOTAS="/q /users"
......@@ -26,6 +26,7 @@ FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/users
FSDIR_SHARE=/share
FS_WITH_QUOTAS="/q /users"
WWWHOST=www.emulab.net
TBMAINSITE=1
THISHOMEBASE=Emulab.Net
......@@ -78,6 +78,7 @@ FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/users
FSDIR_SHARE=/share
FS_WITH_QUOTAS="/q /users"
#
# You shouldn't have to change anything below this point
......
......@@ -19,3 +19,4 @@ TBSTATEDEMAIL=kwebb@cs.utah.edu
TBTESTSUITEEMAIL=kwebb@cs.utah.edu
WWWHOST=www.emulab.net
WWW=www.emulab.net/~kwebb/www
FS_WITH_QUOTAS="/q /users"
......@@ -22,6 +22,7 @@ OURDOMAIN=mini.emulab.net
FSDIR_GROUPS=/z/groups
FSDIR_PROJ=/z/proj
FSDIR_USERS=/z/users
FS_WITH_QUOTAS="/z"
TBSTATEDEMAIL=minitestbed-stated@flux.cs.utah.edu
TBTESTSUITEEMAIL=minitestbed-testsuite@flux.cs.utah.edu
SFSSUPPORT=0
......
......@@ -22,3 +22,4 @@ WWWHOST=www.emulab.net
WWW=www.emulab.net/~newbold/www
THISHOMEBASE=Mac.Emulab.Net
TBAUTHTIMEOUT=216000
FS_WITH_QUOTAS="/q /users"
......@@ -17,3 +17,4 @@ TBTESTSUITEEMAIL=newbold@flux.utah.edu
WWWHOST=www.emulab.net
WWW=www.emulab.net/~newbold/www
THISHOMEBASE=Mac.Emulab.Net
FS_WITH_QUOTAS="/q /users"
......@@ -23,3 +23,4 @@ WWW=www.mini.emulab.net/~newbold/www
TBCOOKIESUFFIX=-mini
THISHOMEBASE=Mini.Emulab.Net
TBAUTHTIMEOUT=216000
FS_WITH_QUOTAS="/z"
......@@ -20,3 +20,4 @@ TBSTATEDEMAIL=rchriste@cs.utah.edu
TBTESTSUITEEMAIL=rchriste@cs.utah.edu
WWWHOST=www.emulab.net
WWW=www.emulab.net/~ricci/www
FS_WITH_QUOTAS="/q /users"
......@@ -24,3 +24,4 @@ FSDIR_USERS=/users
WWWHOST=www.emulab.net
WWW=www.emulab.net/~ricci/www
FS_WITH_QUOTAS="/q /users"
......@@ -28,3 +28,4 @@ WWWHOST=www.mini.emulab.net
WWW=www.mini.emulab.net/~ricci/www
TBCOOKIESUFFIX=-mini
THISHOMEBASE=Mini.Emulab.Net
FS_WITH_QUOTAS="/z"
......@@ -23,3 +23,4 @@ TBTESTSUITEEMAIL=shash+testsuite@cs.utah.edu
WWWHOST=www.emulab.net
WWW=www.emulab.net/~shash/www
THISHOMEBASE=Shash@Emulab.Net
FS_WITH_QUOTAS="/q /users"
......@@ -28,3 +28,4 @@ WWWHOST=www.mini.emulab.net
WWW=www.mini.emulab.net/~shash/www
TBCOOKIESUFFIX=-mini
THISHOMEBASE=Mini-Shash@Emulab.Net
FS_WITH_QUOTAS="/z"
......@@ -21,3 +21,4 @@ TBTESTSUITEEMAIL=stoller@fast.cs.utah.edu
WWWHOST=www.emulab.net
WWW=www.emulab.net/~stoller/www
THISHOMEBASE=Stoller.Emulab.Net
FS_WITH_QUOTAS="/q /users"
......@@ -16,6 +16,7 @@ OURDOMAIN=ballmoss.com
FSDIR_GROUPS=/groups
FSDIR_PROJ=/proj
FSDIR_USERS=/users
FS_WITH_QUOTAS="/proj /groups /users"
TBSTATEDEMAIL=stoller@stoller.casco.net
TBTESTSUITEEMAIL=stoller@stoller.casco.net
WWWHOST=golden-gw.ballmoss.com:9876
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment