Amazon Linux 2023 で cron を利用出来るようにする
Amazon Linux 2023 には cron が含まれておらず、スケジュール実行機能を利用したい場合は systemd を使う必要があります。 この仕様については AWS re:Post に Amazon Linux 2023 does not contain /etc/cron.d folder という投稿がされており、以下のように記載されています。
Amazon Linux 2023 does not contain "/etc/cron.d" folder. Our application need to add few services installed in this folder. It was supported in Linux 1 and 2. I am running the below command to create the "cron.d" folder in Amazon Linux 2023. "sudo yum install cronie -y" Is this an acceptable workaround? Will this folder no longer be part of any future releases? Please suggest. Thanks Arahanth
他にも GitHub に https://github.com/amazonlinux/amazon-linux-2023/issues/300 という同様の投稿がされています。 今後はスケジュール実行機能も systemd へ移行する方が好ましいのかも知れませんが、今回は「古いアプリケーションとの互換性も考えて敢えて Amazon Linux 2023 へ cron をインストールする」手順をメモしておきます。