PHP-script for checking log-files updates.
Script checks each log-file size. If file is not empty then script sends a message to you and moves all content to the "archive" for this file.
-
Clone this rep
-
Set up config.php
# For each log-file you should add config array
array(
'domain' => 'CodeX dev server',
'logFilePath' => '/var/log/apache2/error.log',
'codexBotLink' => 'https://bot3.ifmo.su/notifications/ABCD1234',
),
Get codexBotLink
from @codex_bot
- Set up autorun
Edit cron
crontab -e
To run script every 5 min add this line
*/5 * * * * php -q /root/logs-checker/script.php