LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to copy a file from another server to local? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-copy-a-file-from-another-server-to-local-746687/)

thomas2004ch 08-11-2009 05:34 AM

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?

linuxlover.chaitanya 08-11-2009 05:36 AM

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

centosboy 08-11-2009 05:41 AM

Quote:

Originally Posted by thomas2004ch (Post 3639012)
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

sycamorex 08-11-2009 05:44 AM

Code:

scp remote_username@remote_host:/var/log/httpd/mod_jk.log ./
Hope that helps


All times are GMT -5. The time now is 03:35 AM.