How Do I Download a Backup File of a Day from the OBS Bucket?
This topic describes how to use obsutil to download a backup file of a day from the OBS bucket to the local host.
- Ensure that source objects in the OBS bucket do not change. Otherwise, the download may fail or data may be inconsistent.
- If the objects to be downloaded are in the OBS Archive storage class, you must restore the objects first. Otherwise, the download fails.
Procedure
- Log in to a server as user root using a key or password.
- Run the following command to recursively download all files and folders (including the folder itself) in the bucket to a local path:
./obsutil cp obs://obs_path/Year/Month/Day/Local path -r -tempFileDir= a specified path -f
In the preceding command:
- obs_path: OBS bucket path, for example: obs-sap/hana
- Year/Month/Day: directory of a folder in the OBS bucket. For example: 201905/28.
- Local path: path where the files are stored on the local host. For example: src1.
- tempFileDir= a specified path: Directory for storing temporary files during multipart download. The default value is the value of defaultTempFileDir in the configuration file. You can also specify a path.
- Temporary files generated during multipart download are stored in this directory. Ensure that the user who runs obsutil commands has the write permission on the path.
- The available space of the path must be greater than the size of the objects to be downloaded.
For example, in the obs-sap bucket, download the backup files of May 28, 2019 to the local path src1. The command is as follows:
./obsutil cp obs://obs-sap/hana/201905/28 /src1 -r -tempFileDir=/hana/backup -f
For more information about obsutil, see Introduction to obsutil.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot