Avatar of thomasliju
thomasliju asked on

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/
Linux

Avatar of undefined
Last Comment
thomasliju

8/22/2022 - Mon
omarfarid

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
Seth Simmons

if you are on one of those 2 servers then you don't need to specify credentials for the one you are on
ASKER
thomasliju

can we do scp from source or target..
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
omarfarid

yes
ASKER CERTIFIED SOLUTION
Seth Simmons

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
thomasliju

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:
ASKER
thomasliju

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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
omarfarid

I am not familiar with this syntax

what are you trying to do?
Seth Simmons

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
ASKER
thomasliju

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:
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER
thomasliju

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:
Sandy

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
ASKER
thomasliju

yes that is correct use of scp.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.