Use rsync and crond servers for WEB Service backup, rsynccrondBack up WEB services using rsync and crond serversScenario:A company has a Web server. The data in the server is very important, but if the hard disk breaks down, the data will be lost.Now the leaders ask you to back up data on other machines. The requirements are as follows:At every night, package the
rsync Simple
The role of rsync is like the general Linux CP and SCP directive, which can be copied from the source location to the destination location, however, rsync is more efficient than CP and SCP in a copy of the file, and supports both the connection and the devices, as well as the retention of the file's owner, group Group and permissions,
In the first c
}.tar.gz[emailprotected]${rsync_hostip}::$ rsyncmodule| | exit1# Delete Compressed Files rm-f${backuptodir}mysql_full_${ip}_${lastfull_backup}.tar.gz To create a scheduled task:Crontab-e#对数据库进行全备份0 1 * * * CD/DATA/SCRIPTS/MYSQL;. /mysql_full_backup.shThis script only executes the VI mysqlbinlog_backup.sh#!/bin/bash# on the Passport server This script is used to back up the binary log files and is completed with the scheduled task # Note: This script
/web-back/, and open permissions for backup users[Email protected] ~]# mkdir/web-back/[Email protected] ~]# chown backup:backup/web-back/(6) Copy all files under the Web server/boot/directory to the/var/www/html/directory for push testing(7),rsync-avz--delete/var/www/html/[email protected]:/web-back/Command Push testSecond, establish a virtual user on the backup
☆☆☆ Daily automatic backup site data and database upload ftp☆☆☆
This way, the main is a script (including compressed site data and database, upload), and then use the cron command every day in a specified period of time to run, see the script code (script information needs to set itself)
The code is as follows
Copy Code
#!/bin/bash
#以下信息请自
I did not use, save the reference later
Reprint Source: Http://outofmemory.cn/wr/?u=http%3A%2F%2Fsmilejay.com%2F2012%2F02%2Frsync_remote%2F
Two days ago, I checked the department's test data and file backup situation, see the crontab has an rsync script, I look carefully, manual execution is actually not working properly, mainly because rsync there can not be au
RSYNC software introduction:Rsync is a data image backup tool in unix-like systems. It can be seen from the software name-remote sync. Its features are as follows:Images can be used to save the entire directory tree and file system.It is easy to maintain the permissions, time, and soft links of the original file.Installation without special permissions.Optimized process, high file transmission efficiency.Yo
First, the introduction of rsync
Rsync is a data mirroring Backup tool under the Linux system that enables you to back up local system data over the network to any remote host, and Rsync has the following characteristics:
Can be mirrored to save the entire directory tree and file system
Data can be incrementally syn
CentOS Remote Backup Using rsync
This article provides a quick way to back up the most common things in a typical Web host scenario: website files and database data. We will set up a complete daily backup of the folder of a website and copy the data to a remote server (this can also work on another VPS ). We will also set up an
Rsync + sersync for real-time file backup
Part 1: operate on the target server 192.168.0.2171. Install Rsync on the OA file backup server1. Disable SELINUXVi/etc/selinux/config # edit the firewall configuration fileThe Code is as follows:
# SELINUX = enforcing # comment out# SELINUXTYPE = targeted # comment outSELINUX
Directory Chapter 1 rsync service configuration process ... 21.1 system Optimization ... 21.2 viewing operating system information and rsync services ... 21.3 Edit rsync service /etc/rsyncd.conf configuration file ... 2 Chapter 2 rsync service setup details ... 32.1 Create rsyn
For system administrators, the focus of their work should be on maintaining the normal operation of the system and providing services normally. A data backup problem is often involved here, as I know, 80% of system administrators do not care too much about the security of their servers. However, they are often quite interested in the backup image technology, however, because the software and hardware prices
explanation:SRC: Monitored directory ()DST: The directory that is backed upWhile the Read D e f:inotifywait command produces three return values, namely "date, time, file", the 3 return values are passed as parameters to read, so "while read D E F" in the script refines the return value.The rsync command explains:/usr/bin/rsync-ahqzt--delete $SRC $DST-A archive mode-H Save Hard Connection-Q Suppress non-er
protected] backup]# md5sum-c check.txtIsn't it intuitive to see OK5. Push back the compressed file to the Rsync backup server, push the complete data to the directory specified by the modulersync-avz/backup/[Email Protected]::backup
monitoring scripts#vi/srv/rsync.shRsync.sh contents are as follows:#!/bin/bashsrc=/srv/test/#监视改文件路径, folder content changes trigger server data synchronizationDes=backup #客服端配置的模块 (customer service side will introduce)Host= "192.168.10.6" #同步到的IP地址, if multiple spaces are separated. For example: host= "192.168.10.6 192.168.10.7"/usr/local/bin/inotifywait-mrq--timefmt '%d/%m/%y%h:%m '--format '%T%w%f '-e modify,delete,create,attrib $SRC | While read
Powerful rsync website automatic backup tool
Rsync is a data image backup tool in unix-like systems-remote sync. A Fast Incremental Backup Tool, Remote Sync, supports local replication or synchronization with other SSH and rsync h
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.