ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    SSH with progress bar?

    IT Discussion
    9
    14
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hobbit666
      last edited by

      Not sure if I just need to use a command correctly or need a new SSH Client,

      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) ???

      S 1 Reply Last reply Reply Quote 0
      • R
        Romo
        last edited by

        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

        H 1 Reply Last reply Reply Quote 1
        • H
          hobbit666 @Romo
          last edited by

          @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 🙂

          1 Reply Last reply Reply Quote 0
          • S
            scottalanmiller @hobbit666
            last edited by

            @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.

            1 Reply Last reply Reply Quote 3
            • D
              dafyre
              last edited by

              If you use SCP you can get a progress bar... or as @Romo mentioned, rsync with --progress.

              1 Reply Last reply Reply Quote 2
              • A
                Ambarishrh
                last edited by

                Just saw this one http://www.tecmint.com/advanced-copy-command-shows-progress-bar-while-copying-files/

                D G 2 Replies Last reply Reply Quote 3
                • D
                  dafyre @Ambarishrh
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 1
                  • G
                    gjacobse @Ambarishrh
                    last edited by

                    @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

                    1 Reply Last reply Reply Quote 0
                    • S
                      stacksofplates
                      last edited by

                      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.

                      S 1 Reply Last reply Reply Quote 1
                      • S
                        scottalanmiller @stacksofplates
                        last edited by

                        @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.

                        T 1 Reply Last reply Reply Quote 0
                        • T
                          travisdh1 @scottalanmiller
                          last edited by

                          @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.

                          S 1 Reply Last reply Reply Quote 0
                          • S
                            scottalanmiller @travisdh1
                            last edited by

                            @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.

                            1 Reply Last reply Reply Quote 1
                            • T
                              thwr
                              last edited by thwr

                              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.

                              T 1 Reply Last reply Reply Quote 2
                              • T
                                travisdh1 @thwr
                                last edited by

                                @thwr That does work, I've done it many a time.

                                I miss my

                                kill -HUP pid
                                

                                Yeah, I like a dead OS 😕

                                1 Reply Last reply Reply Quote 1
                                • 1 / 1
                                • First post
                                  Last post