file size script

file size script

Post by Giuseppe Maggior » Thu, 12 Jun 1997 04:00:00



Hi,
I'd like to notify all the accounts that have a mailbox size longer than
2Mb
Is there a simple way using find command or what else to select all the
mailbox having size more than a fixed limit.
I can easily workaround this adapting the shell script
"/etc/cron.d/logchecker" available on my solaris 2.5 that looks like:

.....
.....
# find the size of the log file (in blocks)
if [ -f $LOG ]
then
        FILESIZE=`du -a $LOG | cut -f1`
else
        exit
fi
.....
.....

but I am sure that there is a simpler and more elegant way to solve it.
Thanks in advance

--
                                                 ( ^^ )

---------------------------------------------oOOO--(_)--OOOo----
Giuseppe Maggiore, INFOGROUP S.p.A.      
Via delle Panche. 140, Firenze 50100,          .oooO
Tel: +39 55 4365736, Fax: +39 55 4365641       (   )   Oooo.
------------------------------------------------\ (----(   )-----
                                                 \_)    ) /
                                                       (_/

 
 
 

file size script

Post by Giuseppe Maggior » Thu, 12 Jun 1997 04:00:00


Hi,
I'd like to notify all the accounts that have a mailbox size longer than
2Mb
Is there a simple way using find command or what else to select all the
mailbox having size more than a fixed limit.
I can easily workaround this adapting the shell script
"/etc/cron.d/logchecker" available on my solaris 2.5 that looks like:

.....
.....
# find the size of the log file (in blocks)
if [ -f $LOG ]
then
        FILESIZE=`du -a $LOG | cut -f1`
else
        exit
fi
.....
.....

but I am sure that there is a simpler and more elegant way to solve it.
Thanks in advance

--
                                                 ( ^^ )

---------------------------------------------oOOO--(_)--OOOo----
Giuseppe Maggiore, INFOGROUP S.p.A.      
Via delle Panche. 140, Firenze 50100,          .oooO
Tel: +39 55 4365736, Fax: +39 55 4365641       (   )   Oooo.
------------------------------------------------\ (----(   )-----
                                                 \_)    ) /
                                                       (_/

 
 
 

file size script

Post by Allen Kirb » Wed, 18 Jun 1997 04:00:00



> Hi,
> I'd like to notify all the accounts that have a mailbox size longer than
> 2Mb

<snip>

cd /var/mail # or wherever your mailboxes are
find . -size +N -print

where N is the number of blocks required to equal 2mb - do 'man find' to
see what the block size is on your system.  On solaris 2.5 it's 512
bytes/block.
--
Allen Kirby                     AT&T ITS Production Services

 
 
 

file size script

Post by Andreas Schw » Thu, 19 Jun 1997 04:00:00


|> Hi,
|> I'd like to notify all the accounts that have a mailbox size longer than
|> 2Mb
|> Is there a simple way using find command or what else to select all the
|> mailbox having size more than a fixed limit.

find /whatever -size +$((2048*1024)) -whatever
--
Andreas Schwab                                      "And now for something

 
 
 

file size script

Post by Terry Carro » Thu, 19 Jun 1997 04:00:00


On Wed, 11 Jun 1997 15:30:28 +0200, Giuseppe Maggiore


>Hi,
>I'd like to notify all the accounts that have a mailbox size longer than
>2Mb
>Is there a simple way using find command or what else to select all the
>mailbox having size more than a fixed limit.

I think:

   find /var/mail/ -size +2000000c -print

should do the selection for you.  It doesn't work for me, but it does
if I change the directory to one I own -- I suspect it's a permissions
thing.

 
 
 

file size script

Post by Pete Houst » Thu, 19 Jun 1997 04:00:00



#Hi,
#I'd like to notify all the accounts that have a mailbox size longer than
#2Mb
#Is there a simple way using find command or what else to select all the
#mailbox having size more than a fixed limit.

find /var/spool/mail -size +2000k -exec whatever

this is GNU find version 4.1

                        Pete

 
 
 

1. How do I get script to list file sizes and file names only?

I have managed to do this long hand but am trying to write a script which
will allow me to list all the files within a directory with only their names
and file size in bytes.

Could someone tell me where I can improve my code as I keep getting an error
where it trys to read the permissions and date.

#Go through the directory listing all the files
#and store copies in a backup file.
for i in `ls -ARl /u01`
{
   cp ${i} ../../log/DaveTest/disk_${i}.bak

#Seperate the two variables that are required
#then store in a file.
awk '{print $5; print $9}' disk_*.bak >> ../../log/DaveTest/diskSize.csv

#Change directory and sort file into ascending byte size.
cd ../../log/DaveTest
sort -cn diskSize.csv

Thanks

Dave Clews

2. GUI

3. File size problem, what is the biggest size of a Linux file?

4. Logitech Portable Trackman: orientation

5. script for finding file sizes

6. Error message

7. script to find all files size > 10m

8. More ptrace fixes for 2.5.33

9. Script for determining file sizes

10. Adding file sizes in a script

11. script to check file size before sending

12. script to check file sizes

13. Copy files using filenames from text files with shell script or bash script