Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sysop-bioinformatics
management_scripts
Commits
2cf0b064
Commit
2cf0b064
authored
Aug 17, 2015
by
Haarst, Jan van
Browse files
script to report xfs quota status on login
parent
b580e085
Changes
1
Hide whitespace changes
Inline
Side-by-side
Z99-quota.sh
0 → 100755
View file @
2cf0b064
#!/bin/bash
# Small script to retrieve quota usage and settings for a user.
#set -o verbose
#set -o xtrace
# Get the real user ID
USERID
=
$(
id
-u
`
logname
`
)
USED
=
`
/usr/sbin/xfs_quota
-x
-c
"report -N -h -L
$USERID
-U
$USERID
"
2>/dev/null|
grep
'^#'
|awk
'{print $2}'
`
SOFT
=
`
/usr/sbin/xfs_quota
-x
-c
"report -N -h -L
$USERID
-U
$USERID
"
2>/dev/null|
grep
'^#'
|awk
'{print $3}'
`
echo
-e
"
\n
You are using
${
USED
}
B of your
${
SOFT
}
B quota in your home folder
\n
"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment