How to automatically send email to users with too large files

How to automatically send email to users with too large files

Post by Howard Ch » Mon, 22 May 1995 04:00:00



I would appreciate if any of you can point me to a script written in
shell language, Perl, Tcl, or awk to automatically check the
user file or directory sizes and send out warnning email
messages to them if their files or directories are too large.
Thank you.

Howard Chen
UIUC

 
 
 

How to automatically send email to users with too large files

Post by William J. Shambl » Mon, 22 May 1995 04:00:00



Quote:

>I would appreciate if any of you can point me to a script written in
>shell language, Perl, Tcl, or awk to automatically check the
>user file or directory sizes and send out warnning email
>messages to them if their files or directories are too large.
>Thank you.

>Howard Chen
>UIUC

Here is a little program I wrote for that purpose. It relies on a system
call, but I run it at 2 am and it does not seem to tax the system unduly.

________________________START_______________________

#!/usr/local/bin/perl

open(OVER,">>/home/sysadm/over-usage2") || die "Can't open: $!\n";

opendir(DIR,"/home") || die "Can't open $!";


      open(DU,"du -s /home/$users |") || die "Can't open: $!\n";
      while(<DU>){
        ($size,$dir)=split(/\s+/,$_);
          $overd=$size-5000;
          $surcharge = int($overd/1000);
            if($size > 6000 && !($users =~ /sysadm/)) {
pen(MAIL,"|/usr/ucb/mail -s 'Disk Usage' $users") || die "Can't open: $!\n";

print MAIL "$users,\n\nThis is an automatic message generated to let you ";
print MAIL "know that your directory \nis over the 5 Megabyte limit by ";
print MAIL "$overd Kilobytes.\n\n";
print MAIL "If you would like to continue to retain this amount of space ";
print MAIL "please \ncontact the the sysadmin at 123-1234 to increase ";
print MAIL "the disk space \nalloted to your account. The price is \$1 per ";
print MAIL "Megabyte in 10 Megabyte blocks.\n\n";
print MAIL "Thank you for your support,\n\n";
         print OVER "The directory $users is over their usage by $overd\n";  

Quote:}


system("/bin/mv  /home/sysadm/over-usage2 /home/sysadm/over-usage2.old");

_________________________END_______________________

Joe

--

 Systems Administrator                                      work 836.5705
 New Media Department (nando.net)                        http://www.nando.net

 
 
 

How to automatically send email to users with too large files

Post by Larry Ga » Thu, 25 May 1995 04:00:00



Quote:

>I would appreciate if any of you can point me to a script written in
>shell language, Perl, Tcl, or awk to automatically check the
>user file or directory sizes and send out warnning email
>messages to them if their files or directories are too large.
>Thank you.

>Howard Chen
>UIUC

There's a csh script called "spacegripe" in Evi Nemeth's book "Unix
System Administration Handbook".  It does exactly what you're asking
for.  Short and simple.

                -- Larry

===========================================================================
+                                                                         +
+ Larry Gale                Systems Engineer                              +

+ (803)-792-6002 (voice)    Center for Computing & Information Technology +
+ (803)-792-8319 (fax)      Medical University of South Carolina          +
+                           171 Ashley Avenue                             +
+                           Charleston, SC 29425                          +
+                                                                         +
===========================================================================

 
 
 

1. Automatically decoding binary files sent in ELM e-mail msg

We're running the elm mail program on SunOS and AIX.  I occasionally have the need to
transfer binary files and it would be easier to send them through e-mail.

So, my question is does ELM have the capability to automatically decode attached binary
files in e-mail messages?  If so, how can it be done?

Please e-mail me any responses I sometimes lose my connection to the news server.

Thanks.
--
______________________________________________________________________________

Department of Mathematical Sciences                         TEL (914) 938-5624
United States Military Academy                              FAX (914) 938-2409
West Point, NY 10996                          

2. Unix Scripting Command "&"

3. extract email from text file and send an email to the email address

4. kde 1.1.1 and keyboard

5. How to automatically send e-mail ad given intervals of time

6. ..CELLular Service.

7. how to set my bluepoint in order to send email automatically?

8. webmin additional modules

9. Unable to send email to large sites.

10. MAILX Question to send automatically to users

11. Automatically save emails as UNIX files

12. Automatically save file via e-mail!!

13. unknown user send to non exist email account