LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   show cp progress with directories (https://www.linuxquestions.org/questions/linux-newbie-8/show-cp-progress-with-directories-926822/)

daisychick 01-31-2012 10:25 PM

show cp progress with directories
 
So, I'm finding tons of nifty little bash scripts, scp tips, rsync tips, etc etc for copying one file to a destination while showing the progress of that copy, however, how would I go about doing this for a directory with sub-directories (cp with -r flag)

i.e. show progress for
Code:

cp -r /mnt/storage/media /mnt/usb/linuxbak
or something similar where media has a dozen files and a dozen sub-directories with files.

All help appreciated in advance! THANKS!

p.s. Running ubuntu server 11.10 so need CLI info!! :D

cbtshare 01-31-2012 10:40 PM

why dont you do
Quote:

rsync -avz --progress

daisychick 01-31-2012 11:35 PM

good enough. I'll man rsync. thanks! :D

daisychick 01-31-2012 11:44 PM

ahhh, no. that's pretty much the same as the verbose option for cp. I'm more looking for a progress meter like wget uses. Thank you for the suggestion though.

cbtshare 01-31-2012 11:55 PM

lol well if you want more info then do

rsync -avz --progress --stats

daisychick 02-01-2012 12:31 AM

ouch. I tried that and I'm only getting 5mb xfer speed going between two hard drives. Both internal sata (limited by the pci bus.) basically a 350mb file takes about 70 seconds to copy. That's kinda long considering I need to copy 661GB. :D is it always this slow?

daisychick 02-01-2012 12:32 AM

ooo. nope. with cp it takes about 5 seconds per 350mb file.

cbtshare 02-01-2012 01:06 AM

well its a trade off, you gotta decide what you want more, speed or you want the progress info similar to wget.Well rsync does that, but its the slowest on local file systems , mv is fastest then cp then rsync.

deep27ak 02-01-2012 01:21 AM

you can use pipe viewer for this purpose which will show you the progress bar of the amount of data copied and left

http://sourceforge.net/projects/pipeviewer/

http://blog.urfix.com/9-tricks-pv-pipe-viewer/

daisychick 02-01-2012 01:54 AM

cool. I will definitely check that out now.

daisychick 02-08-2012 06:55 PM

This ended up being good enough. It shows a percentage completed of current file but not overall progress.

Code:

rsync -azv --progress /source /destination

cbtshare 02-08-2012 07:05 PM

loll, glad you made up your mind :)

daisychick 02-16-2012 07:28 PM

meh, I swear I'm going to figure something out. When you're copying multiple TB, it'd be nice to know when the darned thing is going to finish. :D


All times are GMT -5. The time now is 03:53 PM.