Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to predict df resutls on different machines?!

Posted on 2006-10-20
4
Medium Priority
?
225 Views
Last Modified: 2010-04-20


Hello all,
Let's consider a scenario:

1) User is going to transfer   /usr/local  from Machine A onto Machine B.
2) Obviously, the first thing, would be comparing the size of data  on Machine A to available room on Machine B.
3) User runs  (on local):

# du  -s  /usr/local   in a scrip I have used          du -s  /usr/local | cut  f1

and also doing a query on remote machine using:

                           ssh  $REMOTE_MACHINE  df -k  .    |   awk '{ print $4 }'

then compare them BUT the problem is when I run the same command on a different machine such as Fedora instead of $4
I have to use $3 since $4 on Fedora brought up 56% which is a percentage of used room on remote machine.

Now, how can I predict which one should I use? this script will be used on different machines and has to work just fine.

Your feedback will be appreciated greatly.
Thanks


0
Comment
Question by:akohan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 17779082
df -kP /usr/local # should give portable results...
0
 

Author Comment

by:akohan
ID: 17779173

Hello ravenpl,

Do you mean that I have to df instead of du ?! can you explain it in what them that command is useful?
room occupied by a directory? or available room on a media?


0
 
LVL 43

Accepted Solution

by:
ravenpl earned 375 total points
ID: 17780972
> ssh  $REMOTE_MACHINE  df -k  .
You said that the above gives You different results on various OSes.
try df -kP # P stands for POSIX portable output format
0
 

Author Comment

by:akohan
ID: 17782522


Yes, it is working and thanks
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question