Solved

Copying File to Another Server/Host

Posted on 2008-10-30
5
274 Views
Last Modified: 2010-04-21
Ok part xxx? (I forget) of a job I was clueless of before starting.

http://www.experts-exchange.com/Database/MySQL/Q_23746849.html
http://www.experts-exchange.com/Database/MySQL/Q_23834886.html
http://www.experts-exchange.com/Database/MySQL/Q_23850836.html
http://www.experts-exchange.com/Database/MySQL/Q_23854456.html
http://www.experts-exchange.com/Database/MySQL/Q_23855516.html
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23861816.html


I gave away alot of points recently.

Ok now I need to send a file from one server to another. I have a dump file on my local company server that I need to copy onto the web server, then run it.

I thought maybe I could use ssh/scp but I realize that is not possible because it prompts for a password. Then I found I could use a key to copy it. But I also see that it can be done other ways.

I am very unfamiliar with these commands and not sure which is the best method, or how to write it.

I have PHP available or run commands by Cron Jobs. Or maybe someone can recommend a better way. I'm open to anyway that works.

Thanks.
0
Comment
Question by:SaltyDawg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 22844358
Do you have an account on the other server?  If so, contact the administrator for help with FTP.
0
 
LVL 1

Author Comment

by:SaltyDawg
ID: 22844381
I do have an account, would ftp allow me to do it automatically? Say I wanted to run the script at midnight each day to copy the file to the other server?
0
 
LVL 1

Author Comment

by:SaltyDawg
ID: 22844684
I followed this instruction for creating a public key.

----------------------
ssh-keygen -t rsa


#

In response, you should see:

Generating public/private rsa key pair
Enter file in which to save the key ...


Press Enter to accept this.
#

In response, you should see:

Enter passphrase (empty for no passphrase):


You don't need a passphrase, so press Enter twice.
#

In response, you should see:

Your identification has been saved in ...
Your public key has been saved in ...


Note the name and location of the public key just generated. It always ends in .pub.
#

Copy the public key just generated to all of your remote Linux boxes. You can use scp or FTP or whatever

to make the copy. Assuming you're using root--again, see my warning in step 1--the key must be contained

in the file /root/.ssh/authorized_keys. Or, if you are logging in as a user, for example, clyde, it

would be in /home/clyde/authorized_keys. Notice that the authorized_keys file can contain keys from

other PCs. So, if the file already exists and contains text, you need to append the contents of your

public key file to what already is there.
--------------------------------------------

Your identification has been saved in /home/me/.ssh/id_rsa.
Your public key has been saved in /home/me/.ssh/id_rsa.pub.

but when I attempt to copy it with:
scp id_rsa.pub usr@myhost:ebk

it say no file or directory

Am I doing something wrong
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 22844915
Sure - there aer ways to automate FTP.  One way would be a cron job.

Sorry, I can' t follow that public key stuff.  You would probably want a password-protected login anyway if you're using FTP or something like it to transfer stuff into your site.
0
 
LVL 1

Author Closing Comment

by:SaltyDawg
ID: 31511788
tahank
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Make check boxes work 8 47
while read ID; do 4 59
PHP Curl Problem 10 42
How do I post more than 1 item to php backend 24 32
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question