cp progress bar
Hi,
I have to copy large files from a CD to the hard disk. I want to use a progress bar to display the status of copying the files. Any one has ideas about implementing this in shell script. |
Quote:
|
thanks for your advice
i have found a sample code in this forum Code:
#!/bin/bash anyone can help me, please... |
Here's another sample which maybe abit more usefull.
Code:
#!/bin/bash Code:
#!/bin/bash |
thanks for your resources..
i am sorry to tell that i am newbie and not so understand the above sample codes.. maybe you will ask me to go back study hard..but i really need to solve this problem urgent and dont have time for me to study. believe or not depend on you... below code is easy for me to understand: Code:
#!/bin/bash thanks again.. |
Example: ./test original_file destination_file
This part is the name of my script ------> ./test To use ./test , I made it execute with the command: chmod +x test or you could use the method of : sh test original_file ---------> Is actually a directory in your case. that is /mnt/cdrom destination_file --------> Is actually a directory in your case. ~/Desktop/CDcontents/ So, it might look like this... ./test /mnt/cdrom ~/Desktop/CDcontents/ Because it's a directory, you may need to play with the copy statement. Look into man cp for that. Maybe something like..... cp -R $1 $2 & |
Quote:
|
Quote:
http://www.ex-parrot.com/~chris/software.html |
You can use MC (Midnight Commander). The worlds best console file manager.
To install mc on ubuntu, enable the universe repository from /etc/apt/sources.list by removing the # before the universe repository. Then simply say sudo apt-get install mc and then type mc on the command line to open up the colsole app. |
Quote:
Code:
[mk6032@linuxquestions]# cp movie.avi /srv/nfs/media/video/ if [ -d $2 ] then .... |
code improved
Here it's a little improvement of the script; it should work if the second field is a directory now.
Code:
--- cp_p.org 2008-11-07 10:47:25.934417154 +0100 |
what does:
>"$d" does? I understand everything else, i just dont know what ">$d" by itself does. can someone explain? :) thank you |
>d$
It should create an empty destination file; the script also works without it.
Try it! |
rsync -rv <src> <dst> --progress:
-r for recursive (if you want to copy entire directories) src for the source file (or wildcards) dst for the destination --progress to show a progress bar Honestly, rsync is only a little slower than cp for local copies and is so much better featured. |
pv
You can also look at pv (Pipe Viewer), but honestly, for the specific solution you're looking for--copying a tree of files off a CD-ROM with a progress bar--rsync is the best solution, as nonzenze said.
cRaig |
All times are GMT -5. The time now is 02:07 PM. |