Support Center

How to Clean Logs and Reboot a Sensor Registered to Pulse

Last Updated: Nov 14, 2019 12:02PM EST
For each week a sensor remains online various system logs will grow in size in addition to the log files specific to the Pulse related services. Whereas there is no method presently in use to purge (clean) log files, a sensor being online for a lengthy period of time (i.e. year or more) could inevitably encounter an issue with a lack of drive space leading to services stopping or the sensor abending.

The following script when run as a Script/Task within Pulse on weekly basis has proven useful to remove log files and to ensure the sensor does not encounter an issue involving a lack of drive space. Additionally the sensor will be rebooted upon conclusion of the script running.

#!/bin/bash
systemctl stop pwnscan
systemctl stop pwnix_realtime_wireless
systemctl stop pwnix_kismet_server
systemctl stop blue_hydra
systemctl stop openvas-manager
systemctl stop openvas-scanner
journalctl --vacuum-size=100M
> /var/log/daemon.log
> /var/log/syslog
> /var/log/messages
rm -f /var/log/exim4/*.gz
rm -f /var/log/nginx/*.gz
rm -f /var/log/pwnix/passive_recon/*
rm -f /var/log/pwnix/*
rm -f /var/log/*.gz
rm -f /var/log/*.0
rm -f /var/log/*.1
rm -f /var/log/*.2
rm -f /var/log/*.3
rm -f /var/log/*.4
rm -f /var/log/*.5
rm -f /var/log/*.6
rm -f /var/log/*.7
rm -f /var/log/*.8
rm -f /var/log/*.9
sleep 3
reboot

Contact Us

support@pwnieexpress.com
http://assets1.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete