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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
thomaslijuAuthor Commented:
can we do scp from source or target..
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

omarfaridCommented:
yes
0
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.