Skip to content

Solaris 11.4 で s3cmd #94

@satokaz

Description

@satokaz

https://github.com/s3tools/s3cmd

Solaris 11.4 SRU 87

pipx をインストールしてから、s3cmd をインストール:

$ sudo pkg install pipx

$ pipx install s3cmd
  installed package s3cmd 2.4.0, installed using Python 3.11.13
  These apps are now globally available
    - s3cmd
  These manual pages are now globally available
    - man1/s3cmd.1
⚠️  Note: '/export/home/opc/.local/bin' is not on your PATH environment
    variable. These apps will not be globally accessible until your PATH is
    updated. Run `pipx ensurepath` to automatically add it, or manually modify
    your PATH in your shell's config file (e.g. ~/.bashrc).
done! ✨ 🌟 ✨

/export/home/opc/.local/bin にインストールされるが、path が通ってないので、下記を実行:

$ pipx ensurepath
Success! Added /export/home/opc/.local/bin to the PATH environment variable.

Consider adding shell completions for pipx. Run 'pipx completions' for
instructions.

You will need to open a new terminal or re-login for the PATH changes to take
effect. Alternatively, you can source your shell's config file with e.g.
'source ~/.bashrc'.

Otherwise pipx is ready to go! ✨ 🌟 ✨

$HOME/.s3cfg を作成し、下記をセット。
secret_key (顧客秘密キー) と access_key (アクセスキー) は OCI コンソールの「ユーザー設定」->「トークンおよびキー」tab -> 「顧客秘密キー」から取得(access_key は、秘密キーを生成した後に、生成した秘密キーの3点リーダーをクリックしアクセスキーのコピーで入手)

[default]
access_key = xxxxxyyyyyzzzzz
secret_key = wwwwwvvvvvuuuuu
host_base = <OBJECT STORAGE NAMESPACE>.compat.objectstorage.<REGION>.oraclecloud.com
host_bucket = <OBJECT STORAGE NAMESPACE>.compat.objectstorage.<REGION>.oraclecloud.com
check_ssl_certificate = False

s3cmd ls で、bucket 一覧が見れれば ok

bucket に配置される object がテキストファイル等であれば、s3cmd get s3://bucketname/objectname - で標準出力に出力可能

$ s3cmd get s3://zfs-metadata-bucket/zfs/manifests/tar/82cfca0c5fa2629d/5f3f7a6ad1761d30-155db9f1baff7c0c -
download: 's3://zfs-metadata-bucket/zfs/manifests/tar/82cfca0c5fa2629d/5f3f7a6ad1761d30-155db9f1baff7c0c' -> '-'  [1 of 1]
 954 of 954   100% in    0s    11.88 KB/s{"source": {"id": "6f75d6d5-dc41-ea78-edb8-cb242a6136ee", "name": "ml310eg8v2", "product": "SUNW,ankimo", "version": "ak/nas@2013.06.05.8.87,1-1.1", "data-name": "uni-pool/local/satokaz/Cisco_config", "data-type": "zfs:filesystem", "data-version": "53", "snap-name": "snap_B", "parent-name": "snap_A", "format-name": "tar", "format-version": "v1", "mountpoint": "/export/satokaz/Cisco_config", "creation": "2025-12-10T04:47:30", "space-data": 13661991648, "space-unique": 0, "guid": "5f3f7a6ad1761d30", "parent-guid": "155db9f1baff7c0c", "data-guid": "e9bc476051a13f3e", "data-owner": "6f75d6d5-dc41-ea78-edb8-cb242a6136ee"}, "id": "82cfca0c5fa2629d/5f3f7a6ad1761d30-155db9f1baff7c0c", "started": "2025-12-11T01:26:07", "completed": "2025-12-11T01:26:37", "length": 1171727, "size": 12849905143, "segments": 1, "data": "zfs-primarydata-bucket", "version": 1, "backups": [{"segment": "000000001", "etag": "Oy1A6rqDz1EwaIgKW 954 of 954   100% in    0s    11.85 KB/s  done

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions