Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use periodic synchronization and real-time synchronization in rsync remote synchronization

Shulou Source: shulou.com Published: 2022-06-01 08:37:15 11月11日 Update

This article is about how to use regular synchronization and real-time synchronization in rsync remote synchronization. I think it is very practical, so I share it with you. I hope you can get something after reading this article.

About rsync.

A fast incremental backup tool

1.Remote Sync, remote synchronization 2. Support local replication, or synchronize with other SSH or rsync hosts. Official website: http://rsync.samba.org configure rsync source server

Rsync synchronization source:

Refers to the remote server for backup operations, also known as the backup source configuration rsync source

Basic ideas:

1. Establish rsyncd.conf configuration files and independent account files. Enable rsync-- daemon mode

Application example:

1. User backuper, allowing downlink synchronization 2. The directory of the operation is / var/www/html/

Profile rsyncd.conf

1. Need to build manually, the syntax is similar to Samba configuration 2. Authentication is configured with auth users and secrets file. If not added, it is anonymous.

Rsync account file

1. The record format of "user name: password" is adopted, with one user record per line. Independent account data, not dependent on system account

Enable the rsync service

1. Use the rsync backup tool through-- daemon to provide services alone [execute kill $(catIvar/run/rsyncd.pid) to shut down the rsync service]

Usage of the rsync command:

Rsync [option] original location target location 1. Common options:-a: archive mode, recursively retain object attributes, equivalent to-rlptgoD-v: show details of synchronization (verbose) information-z: compress (compress) when transferring files-H: keep hardconnected files-A: retain ACL attribute information-delete: delete files that are in the target location but not in the original location-checksum: decide whether to skip files based on the checksum of the object

There are two ways to identify the source: format 1: user name @ host address:: shared module name

Tags: Synchronization file monitoring configuration mode input backup service host content real-time password module user task location information action address tool Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology Shulou Information vpn Xiaomi