The data backup operation is very easy. Execute the following command:
Command Explanation: First, use --volumes-from to connect to the container to be backed up. The -v parameter is used to mount the current directory to the /backup directory of the container. Next, back up the contents of the /usr/share/nginx/html directory in the container to the backup.tar file in the /backup directory. Since the current directory has been mapped to the /backup directory of the container, the compressed files backed up in the /backup directory of the container can be immediately seen in the current directory. The execution results are as follows: recover Create a container First, create a container. This container is the container that will use the recovered data. I will create an nginx container as follows: Create a container named nginx3 and mount a data volume. recover Data recovery requires a temporary container, as follows: Command Explanation: First, use the --volumes-from parameter to connect to the backup container, which is nginx3 created in the first step. Then map the current directory to the /backup directory of the container. Then perform the decompression operation to decompress the backup.tar file. The decompressed file location description is an address within the container, but this address has been mapped to the current directory in the host machine, so the file to be decompressed here is actually the file in the current directory of the host machine. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue implements the method of displaying percentage of echart pie chart legend
>>: Implementation of MySQL select in subquery optimization
Every time you log in to the test server, you alw...
This article describes the import and export oper...
This article shares the MySQL installation and co...
I have been engaged in Java web development for mo...
Querying the database SELECT * FROM `student` Que...
①. How to use the alias (CNAME) record: In the do...
1. The role of brackets 1.1 Square brackets [ ] W...
Table of contents Preface Related Materials Achie...
The MySQL slow query log is very useful for track...
NAT In this way, the virtual machine's networ...
The performance of your website or service depend...
Table of contents background Importing virtual fi...
MySQL master-slave configuration and principle, f...
Public free STUN servers When the SIP terminal us...
Table of contents 1. Example scenario 1.1. Set th...