is the Certified module name, which needs to be specified on the client side
Path=/var/mail # need to do a mirrored directory
Comment = Backup Mail # comment
Ignore errors # Ignores some irrelevant IO errors
Read Only = yes # reading only
List = no # does not allow column files
Auth users = postfix # Specify user
Secrets File=/etc/rsyncd.pwd # Authentication file name, mainly save user password, permissions set to 600, owner root, or client will erro
4. Set the client cron job on the server 192.168.11.2. Self-action backup or mirroring per night
0 * * 1-5/root/.test.sh
Note: Automatically run/root/.test.sh for backup every nine o'clock in the evening from Monday to Friday
#more/root/.test.sh
#!/bin/sh
Date= ' Date +%w '
Rsync-tvzrp-e ssh--progress--delete test@192.168.11.7::test/shopu/test/$DATE--password
Assume that there are two linux systems A as the server and B as the backup machine. You need to install rsync software on Ah AB to run the rsync daemon on system, system B regularly backs up data specified by system A through the crontab daemon to implement data backup.
Server Configuration1. Run the command to check
Use rsync can achieve file backup synchronization, a realistic use of the scene is, in the background upload template files, need to sync to another server, through other domain name address access, this need to upload files in the background automatically synchronized to the external access to the server.
Log the sh script for an
One-click rsync server shell script configuration in CentOS
1. Save the following code as a file and upload it to the server named rsync. sh.
#! /Bin/bash
# Rsync Written by zhumaohai
# For more information please visit http://www.centos.bz
Echo "Please input the rsync
Rsync + inotify for real-time server backup
Inotify:
Inotify is integrated into the kernel. inotify is used as a third-party software to monitor directory changes through the interfaces provided by the kernel.
The inotifywait command can monitor fine-grained real-time changes to files in the directory. The monitored command is
Inotifywait-mrq -- timefmt '% d/% m/% y % H: % m' -- format' % T % w % f % e'
What are the restrictions on rsync backup? -- Linux Enterprise Application-Linux server application information. For details, refer to the following section. Environment: Install cwrsync_server_2.0.10_installer.zip in win2003
Linux AS4 U2 installation rsync-2.6.3-1
Objective: To back up win2003 data to Linux
Test backup
First, the service side settings1. Modify server-side configuration# vi/etc/rsyncd.confModify:UID = Nobody # This option specifies the UID that the daemon should have when the module transmits the file. The default value is "nobody".GID = Nobody # This option specifies the GID that the daemon should have when the module transmits files. The default value is "nobody".Max connections = 4 # Maximum number of connections is 4Use chroot = no # no chrootLog file =/var/log/rsyncd.logPID file =/var/run/
LSYNCD on which server to start, this server is like when the server is synchronized, other servers if more files will be deleted, fewer files will be synchronized from this server.
Modifying the contents of the file will also be synchronized
Rsync can achieve synchronization/backup of files, install configuration step to Linux under rsync
program has been suspended state[Email protected] ~]$ Inotifywait-r-e modify,create,delete/tmpsetting up watches. Beware:since-r is given, this could take a while! Watches established.Then /tmp create a new file in the directoryTouch/tmp/newfileThe inotifywait process exits and outputs the following information/tmp/create NewFileSynchronizing changes with rsyncRsync is a fast incremental backup tool. It has several features that make it ideal for us
Remote Automatic Backup rsync + ssh + sshpass: the advantages of mutual automatic backup between remote servers (www.2cto.com rsync) The vast majority of O M personnel know that, simply put, only the files that have been modified are backed up, reduce data transmission volume. At the same time, it can transmit data th
File = Etc/testuser.pas This is the path where the password files are located, which will be described in detail laterThe hosts allow = 192.168.1.56 allows access to the IP address of this server, my client is 192.168.1.56 I'm going to fill this out, modify it as neededHosts deny = 0.0.0.0/0 this thing prevents access to the address.
Okay, finish this. A very important configuration, is the password file, in Figure two, we must not pay attention to a folder, that is, etc folder, good, is
Cross-server/client BACKUP command: rsync usage
Recently, we often need to deploy environments on a new server. Many things can be backed up directly from other servers without re-downloading and installing them.
The rsync command is used:
First, download rsync and install it on the "source server". take part in Bai
details, let us know the process of synchronization-L Keep Soft links-L with this option, the source files are synchronized when the soft link is synchronized-P Keep File permissions property-O Keep File owner-G hold File group-D Keep Device file information-T keep file Time properties--delte Delete files in dest that are not in SRC--exclude filter the specified file, such as--exclude "logs" will be the file name contains logs files or directories filtered out, not synchronized-P shows the sync
Inotify + rsync implements real-time file backup 1. inotify inotify is a powerful fine-grained and asynchronous file system event monitoring mechanism. The Linux kernel has been added to Inotify since 2.6.13, inotify can be used to monitor various events in the file system, such as adding, deleting, modifying, and moving. However, inotify only provides the C language interface, which is inconvenient to call
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.