ITPub博客

首页 > Linux操作系统 > Linux操作系统 > HOWTO Copy files using cp, cpio, dd and tar

HOWTO Copy files using cp, cpio, dd and tar

原创 Linux操作系统 作者:cqubityj 时间:2011-10-13 16:09:56 0 删除 编辑


HOWTO Copy files using cp, cpio, dd and tar

cpio

Copy all files, less than 5GB in size, to another host using SSH:

 find . -size -5G -print0 |cpio --null -oaV | ssh remotehost 'cd /var/lib/xen && cpio -imVd'

I used this example to backup small Xen instances to a second server.

dd

Copy a file to another host using SSH:

 dd if=/source/file | ssh remotehost 'dd f=/destination/file'

I actually used the command below to create a backup of a large (1TB) LVM partition containing a Xen guest image:

 dd if=/dev/vg_dom0/lv_domU_fileserver | ssh zen 'dd f=/dev/vg_md1/lv_domU_guardian'

scp

Secure Copy can only copy regular files - for copying LVM partitions, you'll need to use a different mechanism (for example, using dd|ssh|dd).

 scp /source/file user@remotehost:/destination/file

tar

Tar is nice for copying entire directory trees, including symlinks.

 cd /source/dir && tar cf - . | (cd /destination/dir && tar xvf -)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/228190/viewspace-709109/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 关于PLOGI failed
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2007-12-19

  • 博文量
    133
  • 访问量
    444462