Hi there,

At some point in my Perl script I am downloading a huge file (a tgz 500MB to 1GB in size) using a form of secure copy (I have used Net:SSH2, SFTP, right now I am doing a scp inside a system call, not sure what the final variant will be). Because this happens on a remote computer (on my computer my script invokes a script on a remote computer and that script is performing the download) and because this does take a while, I would like to be able to send back to my computer progress reports (say every 10% of the download).

Using scp there's real-time feedback on the screen and thus I can follow the download percent by percent but this happens on the remote computer and not where I can see it. Any ideas how I could solve this problem efficiently? I can spin in a loop and check the size of the file against the size of the entire file (which I am sure should be easy to figure) but this seems like a lot of spinning, especially for a 1GB tarball. Any other options out there and I don't know about? It doesn't have to be scp, any king od secure copy will do. In case it makes a difference, this does not run in a webpage, it's simple, plain Perl, no other strings attached

Thanks!


In reply to Long download progress report by RaduH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.