# cp like program with transfer speed



## FestusHagen (Jan 23, 2009)

Hi all,

Is there a cp like copy program that displays transfer speeds.

I see several cp like pgms in the ports but none of them state anything about transfer speeds.

Thanks

O-yea, FBSD 7.1-R, No X!

-Enjoy
fh  : )_~


----------



## cc (Jan 23, 2009)

You can try net/rsync with a --progress flag.  Output looks like this:


```
$ rsync --progress n1* a/
created directory a
n1124.pdf
     3487138 100%   10.59MB/s    0:00:00 (xfer#1, to-check=3/4)
n1169.pdf
      373895 100%  973.68kB/s    0:00:00 (xfer#2, to-check=2/4)
n1256.pdf
     3788603 100%    4.98MB/s    0:00:00 (xfer#3, to-check=1/4)
n1336.pdf
     3793665 100%    3.43MB/s    0:00:01 (xfer#4, to-check=0/4)

sent 11444941 bytes  received 88 bytes  7630019.33 bytes/sec
total size is 11443301  speedup is 1.00
```


----------



## ale (Jan 23, 2009)

You can monitor speed with `$ gstat` or `$ systat -iostat 1`
You can even use scp on localhost.


----------



## FestusHagen (Jan 23, 2009)

ale said:
			
		

> You can monitor speed with `$ gstat` or `$ systat -iostat 1`
> You can even use scp on localhost.



Thank you for your suggestions, but, been there done them!

I find `$ systat -iostat` info interesting but looking at a scale and making a best guess of performance is not my idea of usefull, I like solid numbers!

`$ gstat` gives numbers, what they are I have yet to decifer fully, the color is very annoying, especially if it exits while writing color, and I have yet to get the filter to work, likly my lack of understanding!

I don't see how scp shows transfer rate.

Thank you!

-Enjoy
fh  : )_~


----------



## FestusHagen (Jan 23, 2009)

cc said:
			
		

> You can try net/rsync with a --progress flag.  Output looks like this:



Thank you for your suggestion.

I'll have to give it a try.

Thanks

-Enjoy
fh  : )_~


----------



## ale (Jan 23, 2009)

FestusHagen said:
			
		

> Thank you for your suggestions, but, I don't see how scp shows transfer rate.




```
$ scp /usr/ports/packages/All/docbook-xsl-1.74.0_1.tbz ale@localhost:/tmp
docbook-xsl-1.74.0_1.tbz                      100%   33MB  10.9MB/s   00:03    

$ scp -r mp3/Nine\ Inch\ Nails\ -\ The\ Slip ale@localhost:
01 999,999.mp3                                100% 3060KB   3.0MB/s   00:00    
02 1,000,000.mp3                              100% 8289KB   8.1MB/s   00:00    
03 Letting You.mp3                            100% 8265KB   8.1MB/s   00:00    
04 Discipline.mp3                             100% 8468KB   8.3MB/s   00:01    
05 Echoplex.mp3                               100% 8841KB   8.6MB/s   00:00    
06 Head Down.mp3                              100% 9236KB   9.0MB/s   00:00    
07 Lights in the Sky.mp3                      100% 4752KB   4.6MB/s   00:01    
08 Corona Radiata.mp3                         100%   12MB  12.0MB/s   00:00    
09 The Four of Us are Dying.mp3               100% 8378KB   8.2MB/s   00:00    
10 Demon Seed.mp3                             100% 9851KB   9.6MB/s   00:01    
theslip.pdf                                   100% 7519KB   7.3MB/s   00:00
```


----------



## FestusHagen (Jan 24, 2009)

ale said:
			
		

> ```
> $ scp /usr/ports/packages/All/docbook-xsl-1.74.0_1.tbz ale@localhost:/tmp
> docbook-xsl-1.74.0_1.tbz                      100%   33MB  10.9MB/s   00:03
> ```



I get nothing with scp, I don't see a difference between cp and scp... Guess I'm missing something.

Thanks

-Enjoy
fh  : )_~


----------



## ale (Jan 24, 2009)

FestusHagen said:
			
		

> I get nothing with scp, I don't see a difference between cp and scp... Guess I'm missing something.


From the scp man page:
	
	



```
-q      Disables the progress meter.
```
so, unless you are using an alias or something else, if you are not using _-q_ it should display a progress meter.
Is your `$ $ which scp` /usr/bin/scp?


----------



## FestusHagen (Jan 25, 2009)

ale said:
			
		

> Is your `$ $ which scp` /usr/bin/scp?



Yup, That's the one, used no option args.
Just:
	
	



```
/usr/bin/scp /source /destination
```

Thanks

-Enjoy
fh  : )_~


----------



## ale (Jan 25, 2009)

FestusHagen said:
			
		

> Yup, That's the one, used no option args.
> Just:
> 
> 
> ...


And what with 
	
	



```
/usr/bin/scp /source $USER@$HOSTNAME:/destination
```
as in my examples?


----------



## FestusHagen (Jan 25, 2009)

ale said:
			
		

> And what with
> 
> 
> 
> ...



That works, but I purposly left out the user@host due to the fact that it then requires authentication, I don't need nor want authentication.

It's use will be in scripts.

Thank you for your help.

-Enjoy
fh  : )_~


----------



## ale (Jan 25, 2009)

FestusHagen said:
			
		

> That works, but I purposly left out the user@host due to the fact that it then requires authentication, I don't need nor want authentication.
> 
> It's use will be in scripts.


ssh-keygen(1)


----------



## FestusHagen (Jan 25, 2009)

ale said:
			
		

> ssh-keygen(1)



Yup, Thanks, Read it already...

The whole thing is to much pain just to copy files with transfer info...

Thank you very much for all your responces.

-Enjoy
fh  : )_~


----------



## superHal44 (Mar 24, 2009)

*scp examples*

i was playing with scp options founds some good examples here: scp examples

hope that helps


----------



## Carpetsmoker (Mar 24, 2009)

Maybe one of these will work for you?

misc/clpbar
textproc/bar


----------



## bobveznat (Mar 26, 2009)

If you're wanting to test a new harddrive or something I'd recommend dd(1).

To test write speed:


```
$ dd bs=4096 count=20000 if=/dev/zero of=$HOME/testcrap
20000+0 records in
20000+0 records out
81920000 bytes transferred in 1.301245 secs (62955094 bytes/sec)
```

I'm not sure exactly how accurate this is reading from /dev/zero. I'm not sure if disk drives can write zeroes faster than ones or anything. Seems far fetched but possible.

To test read speed (notice that this time "testcrap" is in the filesystem cache and thus gets read very very quickly):


```
$ dd bs=4096 count=20000 if=$HOME/testcrap of=/dev/null
20000+0 records in
20000+0 records out
81920000 bytes transferred in 0.057060 secs (1435681656 bytes/sec)
```

In both of those examples change the count parameter to write a larger or smaller file. I'd leave blocksize (bs) alone.

A seemingly related tip is that in FreeBSD cp(1) supports SIGINFO. Typically you can send SIGINFO to a process by pressing ^T while it's running. For cp(1) it shows the transfer status, though it does not include transfer rate.


----------

