Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

6 commonly used Rsync commands

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "six commonly used Rsync commands". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the "six commonly used Rsync commands"!

Rsync tools are very simple and convenient to use, and can enhance the security of operations if used properly. In addition, it can also be used as a security detection tool to complete the integrity audit of the file system without the support of any other software.

Rsync uses 1. You can resume upload at breakpoints, and when you use rsync-avzP xxx remotehost:/xxx/, you can resume it. Please refer to the "Shell" section of "how rsync should be used":

If the transfer is interrupted while copying the file, the default action of rsync is to undo the pre-operation, that is, to delete some of the copied files from the target machine. If you want to continue the file on the next copy and do not need to re-copy all the files, you can use the-partial option to prevent rsync from deleting the copied parts if the transfer is interrupted. If you want to use both the-partial and-progress options, you can use the-P option, which is a more convenient option provided by rsync instead of both.

But one thing to note is that when you need to resume transmission, you can't take the-z parameter, otherwise you will fail.

Rsync use 2. When using cwrsync in windows, you can write the cwrsync directory to the system environment variable, so that you don't have to run the rsync command in the cwrsync installation directory every time.

Rsync use 3. When you need to connect to a file in windows, the drive letter cannot be directly used such as c:\; d:\, etc., and needs to be converted:

Example: C:\ WORK\ *-- > / cygdrive/c/work/*

Example 1-rsync recursively to a unix server with an openssh server:

Rsync-r / cygdrive/c/work/ remotehost:/home/user/work/

Example 2-Local rsync recursively

Rsync-r / cygdrive/c/work/ / cygdrive/d/work/doc/

Example 3-rsync to an rsync server recursively:

(Double colons?? Yeshire!)

Rsync-r / cygdrive/c/doc/ remotehost::module/doc

Rsync uses 4. When you need to transfer files from a linux system to windows, you can transfer them in reverse, as follows:

Rsync-avzP remotehost:/home/user/work/xx.xx / cygdrive/c/work/

At this point, I believe you have a deeper understanding of the "six commonly used Rsync commands". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report