Hi Thomas,

> For one thing, you're using just "du" to call the binary, so we can't
> be sure you're calling the same "du" in each case. So, when logged in
> on the remote machine, do "which du" and use the resulting fully
> qualified path in your rexec call.

Check, this is ok - locally an remotely /usr/bin/du is used.
 
> Also, look at your environment ("set" and "alias") on the remote
> machine to see wether you're getting additional options that way.

I don't think I will find the answer there - because it's getting even more 
strange: I copied the questionable code to a separate file, for testing 
purposes. Funnily, it worked just as expected:

#!/usr/bin/perl -w
use strict;
use warnings;
use Filesys::DiskUsage qw/du/;

my $backuphost="hsr3s1p7";
my $backupdir="/backup";
my $localdir="/opt/app/oracle/oradata4/dumps";
my $backdir="MVSTADB_9.9.99.99_100505-085707";

my $backdir_used = du( { 'sector-size'=>512 }, "$localdir\/$backdir" ); # zum 
Berechnen
chomp($backdir_used);
my $backdir_used_kb = $backdir_used/1024; # zur schönen Ausgabe
print "needed space: $backdir_used_kb KB\n";

my ( $rc2, $backupsizetrans ) =
        rexec(
                $backuphost,
                '$(which du) -k ' # KB, zum Berechnen
                . "$backupdir\/$backdir"
                . ' |tail -1 |awk \'{ print $1 }\''
        );
chomp($backupsizetrans);
print "Backup size after ftp: $backupsizetrans KB\n";

gives me exactly the same:

oracle:/opt/data/magna/wartung/work/nora>./test.pl
needed space: 68 KB
Backup size after ftp: 68 KB

I am executing both scripts with the same user (oracle) in the same environment 
on the same machine. I even closed the editor, closed all open terminal 
sessions to the machine, re-opened them and immediately executed the scripts. 
Of course, copying the (working) syntax from the extract script back into the 
original source didn't have any effect, no correct result yet.

Really confused now ...

Nora



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to