Restore file được chọn từ Backup file (How do I restore selective files from backup?)
Question
How do I restore files or directories from a container's backup selectively from the command line?
Answer
NOTE: A selective restore can be completed by overwriting files using the copy from the backup. If files from a backup are also to be restored, rename or move the existing files to safe place and then restore the data.
The following command can be used for a selective restore:
Mã:
|
# vzarestore CTID/CThostname --files <files_to_restore> -b BackupId --storage BackupStorage |
For example:
- If you need to restore the /etc folder for container #556:
Mã:
|
# vzlist 556 CTID NPROC STATUS IP_ADDR HOSTNAME 556 19 running - test
|
- You can list the available backups for the container to confirm the backup ID you want to use:
Mã:
|
# vzarestore -l -f -e 556 Show existing backups... CTID: 556 Title: testct Type: full BackupID: 7147dc27-3d25-
- a34f-a5a3-3d457389d3e7/20131023193528 Description: Parent environment: hardware.server.com Size: 277.96 Mb Creation date: 2013-10-24T023528+0007 CTID: 556 Title: testct Type: incremental BackupID: 7147dc27-3d25-
- a34f-a5a3-3d457389d3e7/20131023193714 Description: Parent environment: hardware.server.com Size: 1002.05 Kb Creation date: 2013-10-24T023714+0007
|
- Note: if the backup is located on another node, the command should be the following (the hostname or IP of the backup node can be specified):
Mã:
|
# vzarestore -l -f -e 556 --storage backup.server.com Login to backup.server.com: root root@backup.server.com's password: Show existing backups... CTID: 556 Title: testct Type: full BackupID: 7147dc27-3d25-a34f-a5a3-3d457389d3e7/20131008083001 Description: Parent environment: hardware.server.com Size: 278.05 Mb Creation date: 2013-10-08T153001+0007
|
- If you want to restore the /etc folder from a full backup located on the local node, the command should be the following:
Mã:
|
# vzarestore 556 --files /etc -b 7147dc27-3d25-a34f-a5a3-3d457389d3e7/20131023193528
|
To restore the files from another node, add the option --storage
- with the proper server's name:
Mã:
|
# vzarestore 556 --files /etc -b 7147dc27-3d25-a34f-a5a3-3d457389d3e7/20131008083001 --storage backup.server.com |
Lệnh sử dụng để Restore file được chọn từ file backup lưu trữ trên rs00136
vzarestore 135 --files /var/www/vhosts/hoangngu.com/httpdocs/ -b 94b1be4b-f970-de4b-aa1e-5d6bc503cae8/20140609175949 --storage rs00136.dinodata.vn
http://kb.parallels.com/en/118233