using rsync

using rsync

rsync copies files either to or from a remote host, or locally on the current host (it does not support copying files between two remote hosts).

here are two different ways for rsync to contact a remote system: using a remote-shell program as the transport (such as ssh or rsh) or contacting an rsync daemon directly via TCP. The remote-shell transport is used whenever the source or destination path contains a single colon (:) separator after a host specification. Contacting an rsync daemon directly happens when the source or destination path contains a double colon (::) separator after a host specification, OR when an rsync:// URL is specified

USAGE

You use rsync in the same way you use rcp. You must specify a source and a destination, one of which may be remote.

Perhaps the best way to explain the syntax is with some examples:

rsync -t *.c foo:src/

This would transfer all files matching the pattern *.c from the current directory to the directory src on the machine foo. If any of the files already exist on the remote system then the rsync remote-update protocol is used to update the file by sending only the differences. See the tech report for details.

This would recursively transfer all files from the directory src/bar on the machine foo into the /data/tmp/bar directory on the local machine. The files are transferred in "archive" mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer. Additionally, compression will be used to reduce the size of data portions of the transfer.

A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred to the containing directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:


Note also that host and module references don’t require a trailing slash to copy the contents of the default directory. For example, both of these copy the remote directory’s contents into "/dest":


You can also use rsync in local-only mode, where both the source and destination don’t have a ’:’ in the name. In this case it behaves like an improved copy command.

if you got any question , please comment or ping me. I would love that.

Regards,

Shailendra

要查看或添加评论,请登录

Shailendra Kumar的更多文章

  • Free and Open Source Kubernetes Monitoring Tools

    Free and Open Source Kubernetes Monitoring Tools

    I came through this article about 30+ free and opensource monitoring tools for kubernetes. This is awesome collection…

  • Openstack Cinder

    Openstack Cinder

    The OpenStack platform is an open-source collaboration to develop a private cloud ecosystem, delivering IT services at…

  • Nova

    Nova

    Nova, OpenStack Compute service is used for hosting and managing cloud computing systems. It is a component based…

    1 条评论
  • Neutron - openstack networking

    Neutron - openstack networking

    Introduction Neutron, a network service for OpenStack, is a pluggable, scalable and API-driven system for managing…

  • Decoding openstack

    Decoding openstack

    Introduction to OpenStack The OpenStack project is an open source cloud-computing platform for private, public and…

  • Deploying Openstack in lab - Poc Purpose

    Deploying Openstack in lab - Poc Purpose

    This Post describes installing the Liberty release on centos 7.2.

    2 条评论
  • Watch Command in unix

    Watch Command in unix

    watch is an excellent command which can run scripts or commands at a regular intervals or repeatedly. This is very much…

  • Usage of top command

    Usage of top command

    top command is very useful in at the time of debugging the issue , I found this good article for same and felt to share…

    1 条评论

社区洞察

其他会员也浏览了