Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

copyfile

Posted on 2014-02-25
13
Medium Priority
?
147 Views
Last Modified: 2014-10-15
I have a file in /home/miguel directory
is this the command for that..


scp -r miguel@10.1.2.2:/home/miguel/ miguel@10.1.2.3:/home/miguel/
0
Comment
Question by:thomasliju
[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
  • 6
  • 3
  • 3
  • +1
13 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 39885950
Are you copying file or full dir?

If you want to copy file only then

scp -r miguel@10.1.2.2:/home/miguel/filename miguel@10.1.2.3:/home/miguel/

The command you provided will copy dir to dir, and I would recommend to use

scp -r miguel@10.1.2.2:/home/miguel miguel@10.1.2.3:/home
0
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39885964
if you are on one of those 2 servers then you don't need to specify credentials for the one you are on
0
 

Author Comment

by:thomasliju
ID: 39886061
can we do scp from source or target..
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 40

Expert Comment

by:omarfarid
ID: 39886089
yes
0
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 2000 total points
ID: 39886111
you can do scp from the source, target, or any other server
my point was if you are logged into the source server, you don't need to supply credentials for that server you are already on; only for the target
just one less step
0
 

Author Comment

by:thomasliju
ID: 39886235
why it says like this..


nyspcor01g[oracle:coreaux1] 12: ls
afiedt.buf                      expdp_pbc_tables.sh*
alter_user.exe                  expdp_sch.sh*
alter_user.sql                  extract_tablespaces.sql
char_conv/                      gen_export_schemas.sql
chg_idx_tablespace.sql          gen_export_syns_schemas.sql
chg_noparallel.sql              idx_tablespaces.sql
ck_obj.lst                      impdp_sch.sh*
create_dblink.exe               job_sync.exe
create_profiles.exe             job_sync.sql
create_profiles.sql             logs/
create_public_db_links.exe      object_counts.lst.new
create_public_db_links.sql      object_counts.sql
create_public_synonyms.exe      object_counts.sql.new
create_public_synonyms.sql      rc_dblink.sql
create_quotas.exe               rec_dblink.sql
create_quotas.sql               recreate_dblink_with_pswd.exe
create_roles.exe                role_grants.exe
create_roles.sql                role_grants.sql
create_schema_owners.exe        sys_privs.exe
create_schema_owners.sql        sys_privs.sql
create_tablespaces.exe          sys_tab_privs.exe
create_users.exe                sys_tab_privs.sql
create_users.sql                system_tab_privs.exe
exp_all_sch.sh*                 system_tab_privs.sql
exp_all_syns_sch.sh
nyspcor01g[oracle:coreaux1] 13: scp -r miguel@10.1.2.2:/home/miguel/ miguel@10.1.2.3:/home/miguel
^Z
Stopped (user)
nyspcor01g[oracle:coreaux1] 14: ^C
nyspcor01g[oracle:coreaux1] 14: ^C
nyspcor01g[oracle:coreaux1] 14: ^C
nyspcor01g[oracle:coreaux1] 14: scp -r nyspcor01g[oracle:coreaux1] 13: /ldba/pcor01/10gR2_migration_to_exadata/gen_export_schemas.sql nj09mhf0362[oracle:sprefuat1] 4:/ldba/exp_script

No match
nyspcor01g[oracle:coreaux1] 15: nyspcor01g[oracle:coreaux1] 15:
0
 

Author Comment

by:thomasliju
ID: 39886273
Anything wrong with this

command


scp -r nyspcor01g[oracle:coreaux1] 13: /ldba/pcor01/10gR2_migration_to_exadata/gen_export_schemas.sql nj09mhf0362[oracle:sprefuat1] 4:/ldba/exp_script
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 39886514
I am not familiar with this syntax

what are you trying to do?
0
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39886687
looks like you copy and pasted your shell prompt

remove the nyspcor01g[oracle:coreaux1] 13: part and the other one near the end
replace that with the user name and host name as it's formatted above - assuming the /ldba is the start of the path of the source and destination
0
 

Author Comment

by:thomasliju
ID: 39886977
what is the error here
nyspcor01g[oracle:coreaux1] 14: scp -r oracle:10.200.212.157 /ldba/pcor01/10gR2_migration_to_exadata/gen_export_schemas.sql oracle:10.202.146.43 /ldba/exp-schema
/ldba/exp-schema: No such file or directory
nyspcor01g[oracle:coreaux1] 15: ssh: oracle: temporary name resolution failure

nyspcor01g[oracle:coreaux1] 15:
0
 

Author Comment

by:thomasliju
ID: 39887050
nyspcor01g[oracle:coreaux1] 17:  scp -r oracle:10.200.212.157 /ldba/pcor01/10gR2_migration_to_exadata/gen_exp                     ort_schemas.sql oracle:10.202.16.159 /ldba/exp_script/
/ldba/exp_script/: No such file or directory
nyspcor01g[oracle:coreaux1] 18: ssh: oracle: temporary name resolution failure

nyspcor01g[oracle:coreaux1] 18:
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39888016
Try below command

#scp -r oracle@10.200.212.157:/ldba/pcor01/10gR2_migration_to_exadata/gen_export_schemas.sql oracle@10.202.146.43:/ldba/exp-schema

TY/SA
0
 

Author Closing Comment

by:thomasliju
ID: 40383696
yes that is correct use of scp.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

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