Posts tagged with: scp

scp keeping rights and permissions with rsync

We all had once to scp something and keeping owner,group,permissions,etc.

There’s no option like that in scp, so you may want to use rsync for copying the localhost 2.3.2.0-2950 content directory on machine1

[root@localhost ~]# rsync -avI /etc/hadoop/2.3.2.0-2950/ machine1:/etc/hadoop/2.3.2.0-2950

Here are the chosen options :

-a = archive mode (equals -rlptgoD)
-v = verbose
-p = preserve permissions
-o = preserve owner
-g = preserve group
-r = recurse into directories
-I = don’t skip files that has already been transferred