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
1. <body background=image file name bgcolor=co...
I am going to review Java these two days, so I wr...
Table of contents Written in front router.json Ro...
This article shares the specific code of JavaScri...
1. Use css sprites. The advantage is that the smal...
Table of contents 1 Indicators in stress testing ...
This article describes how to build a phalcon env...
Table of contents Function call optimization Func...
Preface Query optimization is not something that ...
Solution Add position:relative to the parent elem...
In MySQL, you can specify multiple indexes for a ...
Hello everyone! I am Mr. Tony who only talks abou...
Table of contents 1. Create a sql script file con...
This article mainly introduces the example analys...
When I created a Docker container today, I accide...