Linux data backup, Incremental backup, and full backup
Source: Internet
Author: User
Linux data backup, Incremental backup, and complete backup-Linux Enterprise Application-Linux server application information. For details, see the following. The company's linux server uses a common desktop and lacks a disaster recovery mechanism. The company stores a large amount of data on this server. Once a fault occurs, the consequences are unimaginable. Therefore, it is necessary to effectively back up important data of this machine. After several days of data collection, I finally compiled my own linux script to implement a complete monthly backup and daily Incremental backup, the packaged file contains a detailed list of files backed up on the current day for future recovery. Incremental Backup stores data within 90, and data earlier than 90 will be automatically deleted. All backup files are saved locally and automatically backed up to another host through the network.
The detailed script content is as follows:
#! /Bin/sh
DATE = 'date + % F-% H'
Host = "192.168.16.17"
Id = "admin"
Pw = "123456"
Ftpdir = "days"
Baktime = 'date -- date = '90 days ago '+ % Y-% m-% d'
Test-e bak1_baktime.tar.gz & rm-f bak $ baktime * | echo Not fonud this files
Store the file in/etc/cron. In the daily directory, this directory is the directory that the system regularly runs. This script runs once a day and completes the current score on the first day of each month. Incremental backup is performed on other dates. some files are not important, so select only. c. h file for backup.
This script is not complete yet. If the script cannot be sent to the remote host, you cannot determine it. I will modify the problem below.
After a simple modification, the script can synchronize the local data and Master/Slave Data. It is widely used.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service