Scp from local to external directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Scp from local to external directory
# 1  
Old 10-18-2010
Scp from local to external directory

Hi,
I am trying to copy a whole directory from my home /RUN1 to the external directory jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/simulations

The command I have used is:

scp -r jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/simulations


The error message I get is:

scp -r jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 [...] [[user@]host2:]file2


Any help? Thanks

---------- Post updated at 06:04 AM ---------- Previous update was at 06:01 AM ----------

I tried this either by being:

I) in my local directory /RUN1 in which using scp prompts me to provide the passeword for jorgensen@hal.oerc.ox.ac.uk
II) in the external directory jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/simulations

I have also tried

scp -r* jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/simulations

This yields error: * illegal
# 2  
Old 10-18-2010
Please check the correct way to use scp command.
Read man pages of scp.

Code:
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i
          identity_file] [-l limit] [-o ssh_option] [-P port] [-S
          program] [[user@]host1:]file1 [...]  [[user@]host2:]file2

Please check bold paths in your command.

Last edited by Poonamol; 10-18-2010 at 08:12 AM.. Reason: format ofcommand is added
# 3  
Old 10-18-2010
Yes I have done so
I want to copy a whole directory,
that is done with the recursive -r

I do not see why

scp -r user@host:/directory should not work
# 4  
Old 10-18-2010
I think you need to provide source and destination paths with scp command.
# 5  
Old 10-19-2010
Actually SCP comand syntax is :
scp -r source destination

U haven't mentioned your source folder path in your command.

You can try like this :
scp -r /homeRUN1 jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/simulations

Or if u r inside /home/RUN1, u can use the following command :
scp -r . jorgensen@hal.oerc.ox.ac.uk:/home/compchem/jorgensen/simulations

Note , one dot '.' is there after -r , it denotes 'present directory' as source
# 6  
Old 10-19-2010
With all *cp -r, the thing to be careful about is that the target is a directory you want to put the source directory into. Only scp has a -d option to help you ensure this. Commands should be repeatable with identical effect.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Ping domain indicates the external ip address and not the local ip

when i execute from local machine ping domainname i get the external ip address but i am on local dns and i expect the local ip address.. using nslookup : no problem so i cannot find why... thanks (2 Replies)
Discussion started by: activedms
2 Replies

2. Shell Programming and Scripting

scp from variable date directory

I am trying the mentioned script as #!/usr/bin/expect -f # connect via scp spawn scp root@10.71.15.34:/apps/log/ui/(date +\%Y\%m\%d)/BATCH*.log /root/BATCH_VSAT_MME01.log ####################### expect { -re ".*es.*o.*" { exp_send "yes\r" exp_continue } -re ".*sword.*" { exp_send... (2 Replies)
Discussion started by: Yogesh Pawar
2 Replies

3. Shell Programming and Scripting

Replicate remote directory to local directory with ftp

I have system that generate files every 1 hours , i only have ftp connection from my local server to remote . $ ls -al -rw-r--r-- 1 water None 0 Feb 7 18:09 a.0800 -rw-r--r-- 1 water None 0 Feb 7 18:09 a.0900 -rw-r--r-- 1 water None 0 Feb 7 18:09 a.1000 is there any perl / php... (3 Replies)
Discussion started by: before4
3 Replies

4. Shell Programming and Scripting

How to run the Shell Script from external directory using java?

Hi, I have created a Shell Script and invoke through java using Process Builder It's working fine, if (Shell script file ) in the same directory as java file. By Problem: How to run the Shell Script file( resides in external directory) using java. What configuration i have... (1 Reply)
Discussion started by: nanthagopal
1 Replies

5. UNIX for Dummies Questions & Answers

SCP error: No such file or directory

Hi, I am trying to do scp using the following script: #!/usr/local/bin/bash BUILDDATE=20120220 for line in `cat arch_host_plat_src_dest` do src=`echo $line | cut -d: -f4` dest=`echo $line | cut -d: -f5` echo scp -p /builds/${BUILDDATE}/Integration/$src ... (1 Reply)
Discussion started by: Technext
1 Replies

6. UNIX for Dummies Questions & Answers

directory copy with scp

I need to copy all files and directories with scp, but seems I am missing something? /usr/bin/scp -p /custscripts/* rmprod2:/custscripts doesn't copy directories and files under them. Please advise. (1 Reply)
Discussion started by: Daniel Gate
1 Replies

7. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

8. Shell Programming and Scripting

Environment Variable for Local Directory?

This seems like a simple thing, but I can't seem to find an environment variable that has the local/current directory stored in it. I have a script that writes out the files in a directory. I want to append the full path to the file names in the output file. (4 Replies)
Discussion started by: ttilsch
4 Replies

9. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

10. UNIX for Advanced & Expert Users

Using SCP command in IBM AIX to download file from remote to local system

Hi, When i run the code in solaris unix machine, the file from remote server is getting downloaded. but when i use the same code in IBM AIX remote machine, it is not running. It is saying "Erro during scp transfer." Below is the code. Please give some resolution. SCPClient client = new... (1 Reply)
Discussion started by: gravi2020
1 Replies
Login or Register to Ask a Question