Script help with read

From: Karyn Williams (karyn_at_calarts.edu)
Date: 02/23/05

  • Next message: Scott Elliott: "RSC on Sun-Fire-V440"
    Date: Wed, 23 Feb 2005 12:42:39 -0800
    To: sunmanagers@sunmanagers.org
    
    

    Below is a script I am trying to make work but I just can't seem to make it
    right. The purpose is to send an e-mail to a user who is over their quota
    and still in the grace period to alert them. I want to include some user
    specific details like timeleft usage and quota. The catted file is just
    some test names I set up.

    I do not seem to get any values using read. Everything seems to be null.
    This user is over-quota (I made it so). Below is the output to quota -v
    user. The echos were just to test the vars. Solaris 8. Any help would be
    appreciated.

    #!/bin/sh

     for i in `cat /usr/local/tools/gtest.users` ; do

            quota -v $i | tail -1 | read fs usage qta limit timeleft files
    quota limit1

            echo "$REPLY"
            echo "$fs"
            echo `$usage`
            echo '$qta'
            echo ${limit}
            echo $timeleft
            echo $files
            
            mailx -s "Your account on Muse is over-quota" -r
    helpdesk@calarts.edu $i <<EOT

    You are over your quota on Muse. You are currently in the grace period
    which still allows delivery of your e-mail. Please remove files or delete
    old mail. Lack of action will result in lost e-mail and the inability to
    upload files to your account. You have $timeleft left until your mail will
    stop being delivered to your mailbox.

    The Helpdesk can be reached at 661 253 7887 or at helpdesk@calarts.edu.
    Thank you.

    EOT

    done

    # quota -v jcraford
    Disk quotas for jcraford (uid 2709):
    Filesystem usage quota limit timeleft files quota limit
    timeleft
    /export 25734 20000 55000 6.9 days 73 0 0
       
    #

    -- 
    Karyn Williams
    Network Services Manager
    California Institute of the Arts
    karyn@calarts.edu
    http://www.calarts.edu/network
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers
    

  • Next message: Scott Elliott: "RSC on Sun-Fire-V440"

    Relevant Pages

    • Re: Other ways than quotas to limit mail files size ??
      ... Exim can do quotas. ... I've never actually used the quota system myself in Exim but it sounds ... mailboxes, of course, an interlock is a necessity. ... before it changes uid for the delivery. ...
      (freebsd-questions)
    • SUMMARY: Script help with read
      ... David Deaves and Christ Clark said it well "In bourne shell the ... Your quota is $3 Kb and you ... r current usage is $usage Kb. ... >which still allows delivery of your e-mail. ...
      (SunManagers)
    • Re: HELP~215 test about quota
      ... > You want to configure the disk quota scheme. ... > the do not limit disk usage option button for the default quota limit. ... > C.Create a new quota entries for the eight designers user accounts.Select ...
      (microsoft.public.cert.exam.mcse)
    • [UNIX] Bypassing Linux Kernel Quota Limits
      ... Bypassing Linux Kernel Quota Limits ... Disk quotas for user wp: ... Filesystem blocks quota limit files quota limit ...
      (Securiteam)
    • HELP~215 test about quota
      ... You want to configure the disk quota scheme. ... the do not limit disk usage option button for the default quota limit. ... C.Create a new quota entries for the eight designers user accounts.Select ...
      (microsoft.public.cert.exam.mcse)