LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2009, 06:34 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
How to copy a file from another server to local?


Hi all,

I try to copy a file from another server/machine to local. The another server/machine name is s003ap06-acct and the file locates under /var/log/httpd/mod_jk.log

I use the following command
Code:
cp s003ap06-acct:/var/log/httpd/mod_jk.log ./
But I got:
Code:
cp: cannot stat `s003ap06-acct:/var/log/httpd/mod_jk.log': No such file or directory
Someone can help?
 
Old 08-11-2009, 06:36 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
cp command will work on local machine only. If you want to copy from remote machine then you will need to use scp or rcp
 
Old 08-11-2009, 06:41 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by thomas2004ch View Post
Hi all,

I try to copy a file from another server/machine to local. The another server/machine name is s003ap06-acct and the file locates under /var/log/httpd/mod_jk.log

I use the following command
Code:
cp s003ap06-acct:/var/log/httpd/mod_jk.log ./
But I got:
Code:
cp: cannot stat `s003ap06-acct:/var/log/httpd/mod_jk.log': No such file or directory
Someone can help?
use scp or rsync
 
Old 08-11-2009, 06:44 AM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Code:
scp remote_username@remote_host:/var/log/httpd/mod_jk.log ./
Hope that helps
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy files from server 1 to local box? 2639 Linux - Newbie 4 12-16-2008 09:16 PM
How to copy/save a file from a Linux box to a local drive exl75 Linux - General 11 04-10-2007 01:52 PM
Copy file from Server to Local Host foysol_bgd Linux - Newbie 8 02-10-2007 01:35 AM
nfs / nis problem - slow copy to servermounts but fast from server to local hdd krischeu Linux - Networking 1 06-09-2005 12:05 PM
client can't copy files to local machine through vsftpd server on RH9 tree_buddy Linux - Networking 7 09-15-2003 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration