Simple script to logging top processes that load CPU.
- Just download toplog.php and put it to home (or any another) folder.
- Create folder for log files (default /var/log/toplog).
- Copy config for logrotate (toplog.logrotate.conf) into logrotate dir (default /var/etc/logrotate.d).
- Create cron job:
*/5 * * * * php -f /path_to_script/toplog.php >> /var/log/toplog/toplog.log 2>&1