Bashエラー
エラー解決
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 の原因と解決法
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 の原因と具体的な解決手順をまとめました。
エラーメッセージ(全文)
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10
このエラーとは
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 は Bash 開発でよく遭遇するエラーです。
想定環境: Windows / macOS / Linux
よく出る状況: シェルスクリプト / cron
よくある原因
- set -u
- クォート
- cron 環境
解決方法
方法1: shellcheck
shellcheck script.sh.
それでも直らないとき
バージョン情報(Bash のバージョン、OS、実行コマンド)を添えて、エラーメッセージ全文と直前に変更した点を確認してください。ログの数行上にも原因の手がかりが残っていることが多いです。
まとめ
「cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10」は set -u が原因のことが多いです。上記の手順で切り分けてください。
次にやること
同じ Bash カテゴリの関連エラーもあわせて確認してください。
よくある質問
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 とは何ですか?
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 は Bash 実行時に表示されるエラーです。set -u
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 の原因は?
set -u。クォート。cron 環境。
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 の直し方は?
shellcheck:shellcheck script.sh.
Bash で cron が出るのはなぜ?
シェルスクリプト / cron
cron: (10 10 * * *) CMD (/usr/local/bin/job-10.sh) failed with exit code 10 を防ぐには?
。
次に読むべき記事
- find: '/var/log/app-11': Permission denied の原因と解決法
- tar: Error is not recoverable: exiting now on archive backup-12.tar.gz の原因と解決法
- awk: cmd. line:1: syntax error at or near token 13 の原因と解決法
- cron: (58 10 * * *) CMD (/usr/local/bin/job-58.sh) failed with exit code 58 の原因と解決法
- cron: (50 2 * * *) CMD (/usr/local/bin/job-50.sh) failed with exit code 50 の原因と解決法
同カテゴリ「Bashエラー」の記事
- bash: bash: ./script.sh: Permission denied の原因と解決法
- find: '/var/log/app-59': Permission denied の原因と解決法
- find: '/var/log/app-51': Permission denied の原因と解決法
- find: '/var/log/app-43': Permission denied の原因と解決法
- find: '/var/log/app-35': Permission denied の原因と解決法
- find: '/var/log/app-27': Permission denied の原因と解決法
人気記事
- TS2307: Cannot find module '@components/Widget601' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget591' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget581' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget571' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget561' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget551' or its corresponding type declarations の原因と解決法
学習ルート
体系的に学びたい方はこちらから。
エラー・トラブル集で続きを探す →あわせて読みたい
- cron: (58 10 * * *) CMD (/usr/local/bin/job-58.sh) failed with exit code 58 の原因と解決法同カテゴリの関連エラー
- cron: (50 2 * * *) CMD (/usr/local/bin/job-50.sh) failed with exit code 50 の原因と解決法同カテゴリの関連エラー
- cron: (42 18 * * *) CMD (/usr/local/bin/job-42.sh) failed with exit code 42 の原因と解決法同カテゴリの関連エラー
- cron: (34 10 * * *) CMD (/usr/local/bin/job-34.sh) failed with exit code 34 の原因と解決法同カテゴリの関連エラー
- cron: (26 2 * * *) CMD (/usr/local/bin/job-26.sh) failed with exit code 26 の原因と解決法同カテゴリの関連エラー