From: root Date: Sat, 10 Dec 2011 14:38:00 +0000 (+0100) Subject: linux get quota worker X-Git-Url: http://git.rot13.org/?p=cloudstore.git;a=commitdiff_plain;h=49875b28aebbb5f7dcee630a53d2e8139aeadedd linux get quota worker --- diff --git a/gearman/narada_s1_get_quota.sh b/gearman/narada_s1_get_quota.sh new file mode 100755 index 0000000..07a38f2 --- /dev/null +++ b/gearman/narada_s1_get_quota.sh @@ -0,0 +1,14 @@ +#!/bin/sh -xe + +if [ "$1" = "get_quota" ] ; then + while read uid ; do + quota --raw-grace --no-wrap -u $uid | tail -1 | awk '{ print $2 " " $3 }' + done +elif [ "$1" = "start" ] ; then + LD_PRELOAD=/mnt/narada/rootfs/usr/lib/libgearman.so.4 /mnt/narada/rootfs/usr/bin/gearman \ + -h 10.60.0.240 -p 4730 -i /mnt/narada/rootfs/tmp/narada_s1_get_quota.pid \ + -n -f narada_s1_get_quota -w $0 get_quota & +elif [ "$1" = "stop" ] ; then + kill `cat /mnt/narada/rootfs/tmp/narada_s1_get_quota.pid` +fi +