Linux brand-new backup artifact duplicity
Duplicity uses Librsync to produce a very small extra backup. It can generate incremental backups, then use GPG to encrypt, and can be used to send to another server, such as: SCP, FTP, SFTP, rsync, and so on. You can start a backup from any directory, not limited to the load point (Mountpoint), and you can specify which files you want to exclude.
Installation is also simple, using Yum to install and download duplicity source packages, compile and install can also.
If you cannot install using Yum, install the Epel extension source, and then yum install
www.lishiming.net/data/attachment/forum/epel-release-6-8_64.noarch.rpm
For all details, please refer to http://duplicity.nongnu.org
Http://duplicity.nongnu.org/duplicity.1.html
Note: When setting up a backup, please back up the set key at the same time, if the key is lost, the data you backed up cannot be decrypted, so the key is burned multiple CDs as several backups.
Grammar:
duplicity [actions] [options] source_directory Target_url
Action
Full backup is mandatory even if incremental backups are available
INCR uses incremental backups, but ignores the first backup and uses a full backup
Verify compare backup and modification time of current file
List-current-files list the files for the most current backup
Collection-status lists the status of the backup, how many full backups and incremental backups, the time of the backup, and so on.
For example:
1. List the status of the backup files
Duplicity collection-status--ssh-options= "-oport=8888-oidentityfile=/home/abc/sk/id_rsa" sftp://[email Protected]//upload/
#--ssh-options the port number used by the specified link
#-oidentityfile specifying the location of the SSH key
2. Delete files that exist longer than 1 years
Duplicity Remove-older-than 1Y--force ftp://[email protected]/passwords
#--force If this parameter is not added, the files to be deleted are listed without deleting them.
#remove-older-than Delete files older than the specified time
3.
The format is as follows:
duplicity [full|incremental] [Options] source_directory target_url
Duplicity Verify [Options] [--compare-data] [--file-to-restore <relpath>] [--time Time] Source_url
Target_directory
Duplicity Collection-status [Options] [--file-changed <relpath>]
Target_url
Duplicity List-current-files [Options] [--time Time] Target_url
duplicity [restore] [Options] [--file-to-restore <relpath>] [--time Time] Source_url
Target_directory
duplicity Remove-older-than <time> [Options] [--force] Target_url
duplicity Remove-all-but-n-full <count> [Options] [--force] Target_url
duplicity Remove-all-inc-of-but-n-full <count> [Options] [--force] Target_url
Duplicity Cleanup [Options] [--force] [--extra-clean] Target_url
Edit script, perform command backup
Vim duplicity.sh
#!/bin/bash# set up the GPG private key password# here PASSPHRASE is the password for your GPG key #passphrase=xxxxxx#export Passphrase#set The SSH key Password#ftp_password is the password for your SSH keys and is imported into the environment without manually entering the Ftp_password=mypasswordexport ftp_password#upload server Root, exclude/proc/sys/tmp to sftp Server,and no encryption# The following is the backup root,--exclude means/proc/sys/tmp except, it should be noted that duplicit Y documentation specifically indicates that if you want to back up the root, then you have to/proc except for the #--dry-run is not actually running, just testing, and--ssh-options is behind some of the SSH settings, the port number is 8888, The location of the SSH key. duplicity-v5--dry-run--progress--no-encryption--ssh-options= "-oport=8888-oidentityfile=/home/xx/ Private/id_rsa "--exclude/proc--exclude/sys--exclude/tmp/sftp://[email protected]/upload/#unset varunset FTP_PASSW ORD
Although backup is important, single recovery is more important.
Before the backup, list all the backed up files, make sure that the backup files are doing the corresponding reply, if the command is not very skilled, please first on the other machine to play several times, in order to avoid unnecessary errors.
1. List the backed up files
Duplicity List-current-files scp://mybackup/directoryname/home/
Restore a file for a specific date added:--restore-time "2016-09-22"
Conclusion: The duplicity is very good and fast. This is because the use of Libsync makes backups very small, but also because they maintain the index of the backup files so that the entire backup is not read for the file list. The backup file is small and divided into small files so that the source machine does not need much temporary space. It's also easy to use: they can do all the incremental and full backups, so you can focus on what to back up and restore. 、
Cond............
This article is from the "It po" blog, please be sure to keep this source http://907832555.blog.51cto.com/4033334/1855921
Linux brand-new backup artifact duplicity