Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was just curious if there is a way to display a text mode progress bar or percent counter when using cp or another file copy utility so you can see how much of the file has been copied and how much remains. I'm just copying files around the same system. Tried scp and while it copied the file, it didn't display a progress meter. Any suggestions are greatly appreciated.
Gah, I really should finish reading your message before I respond to it, sorry!
You could scp user@localhost:filename filename instead, that'll make it show the progress if you add an ssh-key with no passphrase to your .ssh/authorized_keys it won't hassle you about passwords either. Bit of a cheat though.
OK, I got it to work with this command
scp quick.tar.gz bmcneely@localhost:/tmp/quick.tar.gz
but it still prompts for my password. Here's my ~/.ssh.authorized_keys file
cat authorized_keys
localhost
One last piece to the puzzle, when I run this from a shell script it doesn't show the progress bar. Here's the script:
cat qback
echo Removing old files
rm Q* quick.tar.gz > /dev/null
echo Copying original files for archiving
cp ~/win/data/quicken/Q* . > /dev/null
echo Creating tar file
tar cvf quick.tar Q* > /dev/null
echo Zipping tar file
gzip -9 quick.tar > /dev/null
echo Mounting floppy disk
mount /media/floppy > /dev/null
echo Copying tar file to floppy disk
scp quick.tar.gz bmcneely@localhost:/media/floppy > /dev/null
echo Unmounting floppy disk
umount /media/floppy > /dev/null
echo Backup complete. Remove floppy disk from drive.
Remove the redirection of stdout to /dev/null (> /dev/null), this is what's hiding the progress, because you're piping it to /dev/null instead of displaying it on screen.
Talk about not seeing the forest for the trees. I completely spaced on the output rediection. Thanks for catching that for me. I followed the steps above that I found on the website and that helped me setup the ssh key. Thanks very much.
I was just curious if there is a way to display a text mode progress bar or percent counter when using cp or another file copy utility so you can see how much of the file has been copied and how much remains. I'm just copying files around the same system. Tried scp and while it copied the file, it didn't display a progress meter. Any suggestions are greatly appreciated.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.