Limitation of DiskSpace Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Limitation of DiskSpace Script
# 1  
Old 10-21-2003
Limitation of DiskSpace Script

Hi,

I'm a teacher in Germany and I want to set up a classroom with Linux 8.1 PCs. Every User should have a Max of 100 MB available space. Now I need a script which tells everyone how much diskspace is used in a certain subdirectory.

It should work like that: User enters a command like
diskusage -directory
and the command should list all directories as following:

diskusage -mail
2.3M /mail/spam
1.4M /mail/important
29.2M /mail/private


directories which's sizes exceed 1G should not be listed.

I experimented with "du" but couldn't get the right method. Maybe a combination of "find" and "du" is the right way but I don't get it for some reason.

THX in advance,

Dennis
# 2  
Old 10-21-2003
Re: Limitation of DiskSpace Script

Quote:
Originally posted by Dansen
Hi,

I'm a teacher in Germany and I want to set up a classroom with Linux 8.1 PCs. Every User should have a Max of 100 MB available space. Now I need a script which tells everyone how much diskspace is used in a certain subdirectory.

It should work like that: User enters a command like
diskusage -directory
and the command should list all directories as following:

diskusage -mail
2.3M /mail/spam
1.4M /mail/important
29.2M /mail/private


directories which's sizes exceed 1G should not be listed.

I experimented with "du" but couldn't get the right method. Maybe a combination of "find" and "du" is the right way but I don't get it for some reason.

THX in advance,

Dennis
do a search for my username. i posted a diskusage script a while back. you can modify it to suit your needs.

and comming from a teacher i personaly would expect more then just asking for an answer exspecially w/o showing any work.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Python script for sendmail limitation

Hello, I have a web server (apache, php-fpm) with several vhosts sending mail through php. In order to avoid IP blacklisting when spam is sent by a domain i'm looking for a way to setup a rate limit for outgoing mail and when this limit is reached I want to receive an email warning me that a... (1 Reply)
Discussion started by: draugr
1 Replies

2. Shell Programming and Scripting

Script to monitor diskspace of /home/ not to exceed 80%

I want to monitor the diskspace of the /home/ directory NOT to exceed 80%. I want a script_file.sh for this. I am trying "df -h" command and I am stuck unable to extract the percentage. 1. HOW TO extract the percentage (I believe 5th column)? 2. IF we were able to extract the column,... (8 Replies)
Discussion started by: Shreyas N
8 Replies

3. UNIX for Dummies Questions & Answers

Shc script size limitation and "_SC_ARG_MAX (see sysconf(2))" parameter

I wish to change the parameter (which I do not understand exactly what it is and I wish to) and be able to use shc with very long bash scripts (2 Replies)
Discussion started by: frad
2 Replies

4. Shell Programming and Scripting

DiskSpace Error

Hi, While am preparing the script for diskspace for different partitions different threshhold limit. am getting below error: ./test.sh: syntax error at line 5: `space=$' unexpected Script ==== #!/bin/sh df -h |grep -v '/oradata2'|grep -v '/orabkp' |grep -v '/oradata5' | awk '{ print $5... (7 Replies)
Discussion started by: Pavan83
7 Replies

5. Shell Programming and Scripting

script arg or parameters limitation

Hi, I would like to ask some info on the script arguments/parameters. Does script arguments had limitation like inside or deep inside the loop in which it will not function as it use to be. as an example: $2 not working command2 () { for log in $LOG{1,2,3} do if && ; then echo... (2 Replies)
Discussion started by: jao_madn
2 Replies

6. Shell Programming and Scripting

[ask]elimination with diskspace

dear all, i want elimination file with disk space for example: $ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 62G 19G 41G 31% / /dev/sda1 99M 13M 82M 13% /boot tmpfs 1014M 0... (2 Replies)
Discussion started by: zvtral
2 Replies

7. Shell Programming and Scripting

ASM Diskspace

Hi I want to check Oracle ASM disk status through a PERL script. Script flow would be like this ... 1. Its taking diskgroup name in the command line... 2. Connect to Oracle database 3. If connection error send a critical message. Plz replyyyyyyy...... (1 Reply)
Discussion started by: Harikrishna
1 Replies

8. Shell Programming and Scripting

to compute diskspace

Guys, have any idea for the script like this? also to compute w/ decimal. thanks a=10 b=20 c=30 d=40 if a < b then ( a -b)*1024 = free space b + (c -d) = total space if a > b then (b / d)*1024 = cpu (3 Replies)
Discussion started by: kenshinhimura
3 Replies

9. HP-UX

HP-UX 11i - File Size Limitation And Number Of Folders Limitation

Hi All, Can anyone please clarify me the following questions: 1. Is there any file size limitation in HP-UX 11i, that I can able to create upto certain size of file (say 2 GB) and not more then that???? 2. At max. how many files we can able to keep inside a folder???? 3. How many... (2 Replies)
Discussion started by: sundeep_mohanty
2 Replies

10. UNIX for Dummies Questions & Answers

Diskspace

Hi there, pls help me, i have a problem, how i can find out the disk amount of each harddisk per command (not the on label on the Harddisk) i need it on HP UX and Sun. can anybody helb me???? pls thanks Scotty (1 Reply)
Discussion started by: scotty
1 Replies
Login or Register to Ask a Question