Updated on 2024-09-03 GMT+08:00

obsutil Introduction

obsutil is a command line tool for accessing and managing OBS on Huawei Cloud. You can use this tool to create buckets and upload, download, or delete files/folders. If you are familiar with the command line interface (CLI), obsutil is a good choice in batch processing and automatic tasks.

obsutil is compatible with Windows, Linux, and macOS. Table 1 lists the recommended operating system (OS) versions. To download the obsutil for your OS, refer to Downloading and Installing obsutil.

Table 1 Recommended OS versions for obsutil

OS

Recommended Version

Windows

  • Windows 7
  • Windows 8
  • Windows 10
  • Windows Server 2016

Linux

  • SUSE 11
  • EulerOS 2
  • CentOS 7

macOS

macOS 10.13.4

Advantages

obsutil has the following advantages:

  1. Easy to use
  2. Lightweight and installation-free
  3. Compatible with Windows, Linux, and macOS
  4. Excellent performance and diversified configurations

Application Scenarios

  • Automatic backup and archiving, for example, periodically uploading local data to OBS
  • Operations that you cannot perform using other tools (like OBS Browser+). Such operations include synchronously uploading, downloading, and copying objects.

Functions

Table 2 lists the functions of obsutil.

Table 2 Functions of obsutil

Function

Description

Basic bucket management

Allows you to create buckets of different storage classes in specific regions, delete buckets, and get the bucket list or configuration information.

Basic object management

Allows you to upload, download, delete, and list objects. In detail, you can:

  • Upload one or more files or folders.
  • Upload large files in multipart uploads.
  • Synchronously upload, download, and copy incremental objects.
  • Copy a single object or a batch of objects sharing the same prefix.
  • Move a single object or a batch of objects sharing the same prefix.
  • Resume failed upload, download, or copy tasks.

Logging

Provides logging on your client to record operations on buckets and objects for analysis.

Advanced bucket and object management will be available in later versions of obsutil. You can now use them on OBS Console. For details, see Object Storage Service Console Operation Guide.

Command Line Structures

Below describes how to use commands in obsutil:

  • In Windows

    obsutil command [parameters...] [options...]

  • In Linux or macOS

    ./obsutil command [parameters...] [options...]

  • command indicates the command to execute, for example, ls or cp.
  • parameters indicates mandatory parameters, for example, the bucket name during bucket creation.
  • options indicates additional parameters (which are optional). They must start with a hyphen (-).
  • Square brackets ([]) are not part of commands. Remove them when executing a specific command.
  • You must escape special characters (including & < > and spaces) in a command using quotation marks. Single quotation marks are for Linux or macOS, and double quotation marks for Windows.
  • You can pass additional parameters in the -key=value or -key value format, for example, -acl=private, or -acl private. Both formats are the same. Choose one as you like.
  • In Windows, you can execute obsutil.exe to enter interactive mode. In this mode, you can run command [parameters...] [options...] where obsutil is not needed. Below gives an example:
    Enter "exit" or "quit" to logout
    Enter "help" or "help command" to show help docs
    Input your command:
    -->ls -limit=3 -s
    obs://bucket-001
    obs://bucket-002
    obs://bucket-003
    Bucket number: 3
    
    Input your command:
    -->
  • If you log in to a remote macOS or Linux via SSH to use obsutil, set TMOUT to 0 to prevent obsutil from logging out due to SSH timeout.