Logrotateはcreateolddirオプションを認識しません(Debian)

Logrotateはcreateolddirオプションを認識しません(Debian)

私はlogrotateがログフォルダを動的にクリーンアップするのに非常に便利なcreateolddirコマンドを見つけましたが、他のDebianサーバーでも問題なくうまく機能します。

1 台のサーバーに対してのみ Debian 8 に新しく設定し、すべてのアップデートが完了すると、logrotate は createolddir に対して次のような奇妙なエラーを発生させます。

root@localhost:~# logrotate -d /etc/logrotate.d/fail2ban

reading config file /etc/logrotate.d/fail2ban
error: /etc/logrotate.d/fail2ban:9 unknown option 'createolddir' -- ignoring line
olddir is now /var/log/x_old_logs/fail2ban_old_logs/
error: /etc/logrotate.d/fail2ban:19 error verifying olddir path /var/log/x_old_logs/fail2ban_old_logs/: Datei oder Verzeichnis nicht gefunden
removing last 1 log configs

Fail2banファイルは/etc/logrotate.d/fail2ban次のとおりです。

/var/log/fail2ban.log {

    weekly
    rotate 4
    compress

    delaycompress
    missingok
    createolddir 
    olddir /var/log/x_old_logs/fail2ban_old_logs/     
    postrotate
    fail2ban-client flushlogs 1>/dev/null
    endscript

    # If fail2ban runs as non-root it still needs to have write access
    # to logfiles.
    # create 640 fail2ban adm
    create 640 root adm
}

私もそのオプションを試しましたが、createolddir 644 root root結果は同じでした。

権限はすべて順番になっています。この問題を解決し、logrotateがcreateolddirコマンドを認識する方法を知りません。

ベストアンサー1

Debian 8(Jessie)(バージョン3.8.7)ではサポートされていませlogrotateん。createolddirlogrotate(8)手動あなたのシステムから。

Debian 9(Stretch)にはlogrotateバージョン3.11.0が含まれています。するサポートするcreateolddir

おすすめ記事