[plug] monitor file copy

Mike Holland myk at golden.wattle.id.au
Mon Mar 25 23:03:23 WST 2002


On Mon, 25 Mar 2002, Robert Andrews wrote:

> Hi all how yar going,

Very well. Thankyou for asking.

> How do I monitor the progress of a large file copy from one comp to my linux
> box the copy is from a smbmount directory
> i.e cp /mnt/client/large.avi /home/videos

First, if the copy is that slow, you might find that FTP or HTTP is faster
than SMB. Can you put a mini-server on the source PC?

If we are stuck with SMB, a simple script should do the job. Here is my
attempt:

  !#/bin/sh
  cat $1 | tee $2 |
    while ( dd of=/dev/null bs=1k count=1024  2>/dev/null )
    do echo -n . ; done

But it doesnt work:
- too many dots - 'dd' must be reading less than 1MB at a time
- it doesnt stop. 'dd' doesnt return a useful exit code.

Actually, 'dd' seems to be a dinosaur. A relic of the pre-history of Unix,
before conventions for arguments and exit codes were established.
What should I be using instead? Whats the neatest way to do this
as a shell script?   (No perl allowed :-)

P.S. just checked for other replies and saw Leons.
My man and info (RMS doesnt believe in man pages) pages for 'cp' dont
seem to have and relevant features. Is there something new?

-- 
"The human race is faced with a cruel choice - work or daytime
television" -- Dave Barry





More information about the plug mailing list