Advertisement

08.28.2008 at 08:13AM PDT, ID: 23685831
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Shell Scripting using Bash on Solairs Platform

Asked by conversekid in Bourne-Again Shell (bash), Unix Operating Systems, Shell Scripting

Hi, I use  the script below to find the list of files which could be deleted to save space. Now I want to extend the script so that I can also print the amount of space that could be cleared by deleting the files that were listed in the file named files.out in the script below.

Let me explain. I have the file named files.out which contains the list of several files. I want to find the total space occupied by all these files together. It could be like, listing the files and then summing the $5 using awk,

Thanks in advance,

#!/bin/sh

tempfile="/tmp/available.$$"
verbose=0
trap "rm -f $tempfile" EXIT

cat << 'EOF' > $tempfile
    { sum += $4 }
    { sum1 += $3 }
END { mb = sum / 1024
      gb = mb / 1024
      mb1 = sum1 / 1024
      gb1 = mb1 / 1024
      printf "  \nNote: %.0f GB of available disk space out of %.0f GB of total disk space\n\n", gb,gb1
    }
EOF
printf "Hi WebLogic team,\nPlease analyze and remove the files listed below:\n" > files.out
df -k /WebLogic/apps | awk -f $tempfile >> files.out
find /WebLogic/apps \( -name '*.*log*' -o -name '*.*out*' -o -name '*.*old* -o -name '*.*O' -o '*.*zip* \) -size +499999c -depth -type f -mtime +60 -print >>  /WebLogic/apps/files.out

mailx -s "Space alert on `hostname`" EBIZGSWL@motorola.com < /WebLogic/apps/files.out
exit 0
Start Free Trial
[+][-]08.28.2008 at 08:51AM PDT, ID: 22336361

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Bourne-Again Shell (bash), Unix Operating Systems, Shell Scripting
Sign Up Now!
Solution Provided By: maysara
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.28.2008 at 08:56AM PDT, ID: 22336418

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.28.2008 at 09:41AM PDT, ID: 22336876

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.30.2008 at 11:24AM PDT, ID: 22352802

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.31.2008 at 01:12AM PDT, ID: 22354332

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.31.2008 at 01:24AM PDT, ID: 22354350

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628