SSH with progress bar?
-
@Romo said in SSH with progress bar?:
I don't think the regular cp and mv commands can show the progress of the operation. You could use rsync with the --progress flag, that will show you a progress bar without a problem
Should of said. This is mainly for ESXi when trying to move stuff around
-
@hobbit666 said in SSH with progress bar?:
But is there a way of seeing the progress of cp and mv commands on Linux servers (and ESXi) that you connect to via SSH clients (like Putty) ???
SSH is not a factor here in any way. Things like cp and mv don't have progress bars. SSH just shows you what the command does, SSH doesn't modify the commands in any way.
-
If you use SCP you can get a progress bar... or as @Romo mentioned, rsync with --progress.
-
-
@Ambarishrh said in SSH with progress bar?:
Just saw this one http://www.tecmint.com/advanced-copy-command-shows-progress-bar-while-copying-files/
That looks pretty slick.
-
@Ambarishrh said in SSH with progress bar?:
Just saw this one http://www.tecmint.com/advanced-copy-command-shows-progress-bar-while-copying-files/
While the appearance is a bit different - it appears to be much like the progress bar used in Chocolatey.org
-
You might be able to pipe into pv for a progress. I know it works with dd, so it might work with cp or mv.
-
@stacksofplates said in SSH with progress bar?:
You might be able to pipe into pv for a progress. I know it works with dd, so it might work with cp or mv.
I have never played with pv so don't know what it relies on or when it is likely to work or not.
-
@scottalanmiller said in SSH with progress bar?:
@stacksofplates said in SSH with progress bar?:
You might be able to pipe into pv for a progress. I know it works with dd, so it might work with cp or mv.
I have never played with pv so don't know what it relies on or when it is likely to work or not.
pv is kinda a pain because you have to tell it how much data is moving.
-
@travisdh1 said in SSH with progress bar?:
@scottalanmiller said in SSH with progress bar?:
@stacksofplates said in SSH with progress bar?:
You might be able to pipe into pv for a progress. I know it works with dd, so it might work with cp or mv.
I have never played with pv so don't know what it relies on or when it is likely to work or not.
pv is kinda a pain because you have to tell it how much data is moving.
That's why most things can't show progress bars because they don't know how much there is.
-
What works in some cases is to look at the target side for file operations. That depends a bit on the filesystem and doesn't work for thin provisioned files for example, but for a lot of other things. The watch-command will execute any given command ever N seconds, for example:
watch -n10 'ls -lsah /path/to/target' watch -n30 'du -sh /path/to/target' watch -n1 'df -sh | grep /mnt/point/of/the/target'
In some other cases, you can send specific tools a signal to report stats, for example
kill -USR1 PROCESSID_OF_RUNNING_DD_OPERATION kill -USR1 PROCESSID_OF_RUNNING_CP_OPERATION killall -USR1 rm
Replace USR1 with SIGINFO if you are on BSD or OSX. USR1 is specific to Linux, most other *nix are using SIGINFO.
This will also work with watch or a while-command-sleep loop (watch is basically doing the same in the background).
Quite a few long running operations will report back on USR1/SIGINFO. Check the manpages or just try it.
-