I'm using Net::SFTP (which relies on the all-Perl Net::SSH::Perl module) to automate retrieval of backups, currently, on a Slackware 9.0 machine w/an AMD K6 III running at 530MHz. New/different hardware is not going to happen (except that I could possibly procure a dual cpu Pentium III 450 machine, w/only one cpu :).
At any rate, there ends up being about 4.5GB of backups, when all is said and done. Currently, I can run sftp from the command line (using the OpenSSH implementation of the client, written in C) to download all the backups very quickly. However, my automation script loads the processor (but not the memory) too heavily, I surmise because it is relying on the pure-Perl implementation of SSH, and takes no less than 18 hours to download. Worse, combined with the load of tar and bzip2 when the data goes to tape, the machine crawls to an unacceptable level of performance (I timed the tape job at a couple of hours, which jumps up to over 6 hours when tape & download jobs overlap). Badbadbad.
I really like the Net::SFTP API, it's clean, and saves me tons of code. I was able to build in a debug mode, keyed on a '-d' command line switch, and really don't want to change anything, but I have to. Currently, I'm trying to still use Net::SFTP to build the file hash from the ls() function return info, which is also a highly useful and well written feature. However, I'm forced to farm out the actual file transfers to a filehandle to a process and feeds the SFTP command to the local sftp via stdin.
Besides not entirely working and breaking all of my debugging/diagnostics code, there are problems with this implementation (not to mention that I don't like it). What would be ideal would be a wrapper-based implementation of Net::SFTP, like Net::SSH.
Anyone seen/been-forced-to-build it? Any tips on how I could modify the current Net::SFTP to do so? Has anyone been able to use LWP for this? I guess I'd be willing to switch if it has SFTP functionality.
Any ideas/tips that could rescue my code from rapidly kludging itself into a mire of ugly hackiness?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.