copyfile

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/
thomaslijuAsked:
Who is Participating?
 
Seth SimmonsSr. Systems AdministratorCommented:
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
 
omarfaridCommented:
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
 
Seth SimmonsSr. Systems AdministratorCommented:
if you are on one of those 2 servers then you don't need to specify credentials for the one you are on
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
thomaslijuAuthor Commented:
can we do scp from source or target..
0
 
omarfaridCommented:
yes
0
 
thomaslijuAuthor Commented:
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
 
thomaslijuAuthor Commented:
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
 
omarfaridCommented:
I am not familiar with this syntax

what are you trying to do?
0
 
Seth SimmonsSr. Systems AdministratorCommented:
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
 
thomaslijuAuthor Commented:
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
 
thomaslijuAuthor Commented:
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
 
SandyCommented:
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
 
thomaslijuAuthor Commented:
yes that is correct use of scp.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.