Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Install SSH servers and clients on both server hosts. Then use a CPAN module like Net::SCP or others to securely copy files between servers.

For even more powerful functiontality, consider using git, which supports SSH. There are CPAN modules available that have practically already written the perl code for you.

I have never used one of these modules myself yet, though they look very well documented and easy to use.

I have used rsync, which Arunbear suggested, in the past and it worked well.

Now I usually set up password-less SSH on each server and then use git or scp from the command-line.

To setup password-less SSH (after you have installed an SSH client and server on both hosts):

$ cd ~/.ssh $ ssh-keygen -t rsa

You will be prompted to enter a filename in which to save the key (~/.ssh/id_rsa): <thishost>on<targethost>

$ ssh-copy-id -i <thishost>on<targethost>.pub <targethost>

or for Macs or other OSs which do not have ssh-copy-id:

<targethost>$ cd ~/.ssh <targethost>$ ssh <thishost> cat ~/.ssh/<thishost>on<targethost>.pub +>> authorized_keys

Test SSH with Identity Key:

$ ssh -i ~/.ssh/<thishost>on<targethost> <targethost>

Lastly, create file ~/.ssh/config

Host <targethost> Hostname <targethost> StrictHostKeyChecking no User <Your username> IdentityFile ~/.ssh/<thishost>on<targethost>

The beauty of the config file is, I can ssh into any one of my hosts or mobile devices, regardless of OS, without providing username or password. CAUTION: You MUST carefully protect access to any host on which you use password-less SSH.


Several years ago I used Sparkleshare to sync between desktop hosts/servers, in conjunction with rsync on iOS devices (jailbroken), to keep personal files synchronized. It worked pretty much OK back then. You might want to check it out if your files in question are larger than what Dropbox or iCloud. etc. can handle or if git is not suitable.


In reply to Re: Copy the files between servers by Anneq
in thread Copy the files between servers by ramuks123

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (4)
    As of 2020-07-06 05:48 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found