LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

[RescaleAPI] 計算結果の中から特定のファイルをダウンロードする (計算完了後)

Posted at

0. 前提

事前に下記が実施されていることを前提とします。設定済みであれば飛ばしてOKです。

1. 計算結果の中から特定のファイルをダウンロードする (計算完了後)

1.1 スクリプトの作成

以下のシェルスクリプトを "rescale-download.sh" という名前で保存します。

rescale-download.shの作成
vi ${script}/rescale-download.sh
source
#!/bin/sh

fileId=$1
fileName=$2
TOKEN="${RESCALE_API_TOKEN}"

curl -s -X GET \
-H "Authorization: Token ${TOKEN}" \
-o ${fileName} \
https://platform.rescale.jp/api/v2/files/${fileId}/contents/
実行権限付与
chmod +x ${script}/rescale-download.sh

1.2 実行例

以下の方法で実行します。

保存したい名前の決定
newName="myFile"
結果ファイルのダウンロード
rescale-download.sh ${downloadFileId} ${newName}
result
(返り値なし)
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up