Solved

How to predict df resutls on different machines?!

Posted on 2006-10-20
4
214 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 125 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

734 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