使用 ssh 來 tar 遠端機器的檔案
(ssh root@gate "cd /;
tar cvf - user/intruder var/mail/intruder" ) > gate_user_intruder.tar
(ssh root@div3 "cd /etc; tar cvf - *") | tar xvf -
以此方式取代scp方能將owner,group,symbolic links等屬性一併複製
於target dir
ssh source_ip "cd /source_root_dir;tar cvf - source_dir"|tar xf -
於source dir
tar cvf - complete_source_dir | ssh target_ip "cd /target_root_dir;tar xf -"
tar cvf - ./source_dir | ssh target_ip "cd /target_dir;tar xf -"
使用 tar 來copy local files
tar cf - . |(cd /target;tar xf -)
tar cf - [a-vx-z]* |(cd /target;tar xf-)
沒有留言:
張貼留言