scp vs rsync

23 Jan

1. scp
a. source
[root@rac3 ~]# ls -la /home/oracle/start.sql
-rw-r–r– 1 oracle oinstall 16 Dec 30 07:44 /home/oracle/start.sql
[root@rac3 ~]# scp /home/oracle/start.sql root@172.20.140.11:/home/setijo
start.sql 100% 16 0.0KB/s 00:00

b. destination
[root@ptubs root]# ls -la /home/setijo/start.sql
-rw-r–r– 1 root root 16 Jan 23 08:35 /home/setijo/start.sql

2. scp with preserve
a. source
[root@rac3 ~]# scp -p /home/oracle/start.sql root@172.20.140.11:/home/setijo
root@172.20.140.11’s password:
start.sql 100% 16 0.0KB/s 00:00

b. destination
[root@ptubs root]# ls -la /home/setijo/start.sql
-rw-r–r– 1 root root 16 Dec 30 07:44 /home/setijo/start.sql

3. rsync
a. source
[root@rac3 ~]# rsync -avz /home/oracle/start.sql root@172.20.140.11:/home/setijo
root@172.20.140.11’s password:
building file list … done
sent 80 bytes received 16 bytes 4.68 bytes/sec
total size is 16 speedup is 0.17

[root@rac3 ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin)

b. destination
[root@ptubs root]# ls -la /home/setijo/start.sql
-rw-r–r– 1 agus agus 16 Dec 30 07:44 /home/setijo/start.sql
[root@ptubs root]# id agus
uid=500(agus) gid=500(agus) groups=500(agus)

conculsion
use rsync for copy without change owner and mode file

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: