Help us understand the problem. What is going on with this article?

crontabでAWS CLIの実行結果の出力が一部で途切れた

More than 1 year has passed since last update.

crontabにてAWS CLIでjsonでデータ取得しファイルに保存しようとしたけど
なぜか途中で途切れてハマった次第

describeした時、TAGの内容も出力されていたが、
crontabで実行させるとその日本語文字列部分からすっぱり途切れてたので、
もしかして・・とTAGの内容をアルファベットにしてみたら次に日本語文字列のところで途切れる・・

PYTHONIOENCODING=UTF-8 も試したがうまく行かず・・
あとは、環境変数のLANGかLC_ALLのどちらかかな?と試したところ
LC_ALL環境変数うまくいきました。

例)セキュリティグループをdescribeした場合

#!/bin/sh

#今回の肝はコレ
export LC_ALL=ja_JP.UTF-8

/usr/local/bin/aws ec2 describe-security-groups >  describe-security-groups.json
imaiworks
PHP好き好き大好き!やっぱ好き!
ayudante
いつもユーザー中心で技術者とコンサルタントがとことん考え抜く それがアユダンテです
https://ayudante.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした