Implementation of incremental backup files under Linux __linux

Source: Internet
Author: User
Tags rsync
Before using Windows Server for file backups, Syncfolders is often used to implement incremental backups of files. Now the company's backup server replaced by the CentOS system, want to implement incremental backup thought of rsync. But previously in the study only used RSYNC-AV, unable to achieve incremental backup needs, but looked at the man. On the basis of the original-AV parameters, you also need to add-u and--delete parameter format: RSYNC-AUV--delete DTS SRC For example, you should/etc/backup to/bakup/should be written in RSYNC-AUV--delete/etc/ bakup/
Because the company's backup machine data will be regularly backed up to the mobile hard disk, so I wrote a corner. This can be achieved every time the operation of the mobile hard disk automatic mount, incremental backup, automatic uninstall and so on, and can be based on parameters (File/vedio) to decide which folder to back up. The code is as follows:

#!/bin/bash

#Bakup/dev/sdb1 ' s files (mounted on/samba/file_server) AND/DEV/SDC1 ' files (mounted on/samba/ Vedio_bakup to Udisk (mounted on/mnt
#Author: Cmzsteven
#Create date:2015-04-18

ismounted= ' Df|grep/dev /sdd1|wc-l '
If [$isMounted = 0]; then
mount-t ext4/dev/sdd1/mnt
Fi

Case $ in
' file '
Rsyn C-auv--delete/samba/file_server/mnt
;;
"Vedio")
Rsync-auv--delete/samba/vedio_bakup/mnt
;;
*)
Echo "The args only in file or veido!"
;; Esac

issuccess= ' echo $ '
If [$isSuccess = = 0]; then
umount-l/mnt
Fi

more Linux aspects Information please visit: http://www.aminglinux.com/bbs/?fromuid=4297

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.