###やりたいこと
Rails のログをローテート、圧縮、S3に保存したい
###ためしたこと
調べてみるとローテート自体は Rails.Logger を使う方法と logrotate というコマンドを使う方法があって
圧縮するには後者を使う必要がある
conf ファイルをかいて開発環境でテストしたいのですが
開発環境では docker をつかっていてコンテナ上で logrotate コマンドが存在していなくて
インストールができずに困っています
いろいろな記事ででてくる
yum install -y logrotate bash: yum: command not found
はコマンドが存在しなくて
https://qiita.com/YumaInaura/items/bb1f118255eff46748f7
こちらを参考にして
# apt-get update Ign:1 http://security.ubuntu.com/ubuntu zesty-security InRelease Err:2 http://security.ubuntu.com/ubuntu zesty-security Release 404 Not Found [IP: 91.189.91.23 80] Ign:3 http://archive.ubuntu.com/ubuntu zesty InRelease Ign:4 http://archive.ubuntu.com/ubuntu zesty-updates InRelease Ign:5 http://archive.ubuntu.com/ubuntu zesty-backports InRelease Err:6 http://archive.ubuntu.com/ubuntu zesty Release 404 Not Found [IP: 91.189.88.161 80] Err:7 http://archive.ubuntu.com/ubuntu zesty-updates Release 404 Not Found [IP: 91.189.88.161 80] Err:8 http://archive.ubuntu.com/ubuntu zesty-backports Release 404 Not Found [IP: 91.189.88.161 80] Reading package lists... Done E: The repository 'http://security.ubuntu.com/ubuntu zesty-security Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty-updates Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty-backports Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
# apt-get install -y vim logrotate Reading package lists... Done Building dependency tree Reading state information... Done vim is already the newest version (2:8.0.0095-1ubuntu3). Suggested packages: anacron checksecurity exim4 | postfix | mail-transport-agent mailx The following NEW packages will be installed: cron logrotate 0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded. Need to get 106 kB of archives. After this operation, 368 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu zesty/main amd64 cron amd64 3.0pl1-128ubuntu2 [68.4 kB] Err:2 http://archive.ubuntu.com/ubuntu zesty-updates/main amd64 logrotate amd64 3.8.7-2ubuntu3.1 404 Not Found [IP: 91.189.88.161 80] Fetched 68.4 kB in 2s (23.4 kB/s) E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/logrotate/logrotate_3.8.7-2ubuntu3.1_amd64.deb 404 Not Found [IP: 91.189.88.161 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
となってインストールできません
logrotate を使う以外にもログの圧縮や退避ができる方法があれば教えていただけるとありがたいです

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。