CentOS7 + SoftEther(ログローテーション)

SoftEther VPN

<景品表示法に基づく表記> 本サイトのコンテンツには、商品プロモーションが含まれている場合があります。

SoftEther(ログローテーション)の設定

SoftEther(VPN Server)は3種類のログを出力する事ができます。

    1. サーバログ
    1. 仮想ハブ毎のセキュリティログ
    1. 仮想ハブ毎のパケットログ

SoftEtherはログを出力しっぱなしで削除する仕組みが用意されていません。ローテーションする仕組みを準備する必要があります。

SoftEtherは日付が付いたログファイルなので、logrotateには組み込まずスクリプトを定期的に実行し削除させます。

# cd /etc/cron.daily/
# vi vpnserver

ファイルの更新日付(タイムスタンプ)が30日以前のものを削除させます。

#!/bin/sh
find /usr/local/vpnserver/*_log -name '*.log' -mtime +30 -delete
# chmod +x vpnserver

コメント

  1. 匿名 より:

    #!/bin/sh
    find /usr/local/vpnserver/*_log -name ‘*.log’ -mtime +30 -delete

    if how to zip command

    • りんか りんか より:

      For example

      find /usr/local/vpnserver/*_log -name ‘*.log’ -mtime +30 -exec zip {}.zip {} \;