Solved

copyfile

Posted on 2014-02-25
13
139 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
  • 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 34

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
 
LVL 40

Expert Comment

by:omarfarid
ID: 39886089
yes
0
 
LVL 34

Accepted Solution

by:
Seth Simmons earned 500 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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 34

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now