Your df here takes the last line (tail -1) and prints the first field (awk '{print $1}'. That should leave you with a single word, so the for-loop isn't really necessary.
And the output of df, which varies from system to system, probably wouldn't show the space free in the first field.
On my system (OS X), for example:
the available space would be in "$4", and the used space as a percentage in "$5".
You're also "catting" a couple of files in the else part of your if statement. Where do they come from?
Assuming that /usr/local/fswarn.txt exists, and that /usr/local/bin/exportwarning.txt should be /usr/local/bin/fswarning.txt (!), you could simplify that a bit.
It still needs work (primarily checking that the arguments are given, and valid, but I'm sure you can handle that
first of all thx a lot scottn your help if really great !!!
Your giving me confidence to continue trying to do this
So here is attempt number 3 I wrote that when waiting for a previous answer and don't want it to go to waste so here goes :
Assuming parameter '1' is a mount point and parameter '2' is a percent "free", then :
Hi All,
Its urgent.. pls help me out.. I want to create a KSH which should generate a report with the list of users and the files larger than 5 GB created by them in a direcorty and send autogenerated e-mail to them.
my input would be users list,directory path and the file size (say 5 GB)
... (11 Replies)
Hello.
My name is Alex and I am new to the UNIX environment.
One of the things that I do on a daily basis is I perform backups to tape on a Sun Ultra 25. I use DAT72 tape.
The tape that is currently in the tape drive has about five database backups within it already. I was just hoping... (19 Replies)
Dear All members,
i have some trouble here, i want to ask your help. The case is:
I have some data, it's like:
-ABCD1234
-ABCD1235
-ABCD1237
-BCDE1111
-BCDE1112
-BCDE1114
there is some missing data's sequence (the format is: ABCD = name 1234 = sequence).
I want to print the... (2 Replies)
I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected.
#!/usr/bin/ksh
export MAIL_LIST="tlr.voora@zamn.com"
export ARCH_STATUS=`df -k... (1 Reply)
I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected.
-------------------------------------------------------------------------... (0 Replies)
Hello,
I need Unix script for Checking sequence and get output in a file for missing sequences information.
We are moving archive log to a server for DR .if any files miss from sequence DR will fails. so we need script to monitor sequence of files which are FTP from the Production servers .... (2 Replies)
Hi everyone,
I am writing a script. As a part of this script, I wanted to check the space of few mounts, If the space usage percentage of the mount crosses over a certain limit then i wanted to display a warning message. The following is the command
df -k | awk ' { if (($6 == "/export/temp")... (4 Replies)
Hi Guru's,
I need to check the availability of a web page for every one hour through a script. Following is the requirement.
1. Go to http://vsn.srivsn.com
2. If any error encountered in openeing the home page, it should trigger an email with the appropriate error message.
3. If page opens... (6 Replies)
hi members...
another new probs...
i need to check all the zip files in the server and check for a space or "`" in the file name and if found need to remove them and form a zip file.
i tried using grep command to check for a space but with out success also when i tried checking for "`" as... (6 Replies)