To resolve this issue, create a cron job to clear these files.
- Stop rsyslog
systemctl stop syslog.socket rsyslog.service
- Verify that the service is stopped
ps aux | grep rsyslogd
- Verify in /var/run that rsyslogd.pid does not exist
- Create a directory for the cron job
cd ~
mkdir syslogcron
cd syslogcron/
- Create a file called cleanimf.sh and save it with contents below.
vi cleanimf.sh
#!/bin/bash
find /var/log/vmware/rsyslogd/ -name "imfile-state*" | xargs -i rm -f {}
- After saving the file (by typing ':wq'), apply permissions to the file
chmod 755 cleanimf.sh
- Create a cron job to execute the script every hour (remember to save the file with ':wq')
cd /etc/cron.d
vi cleanimf.cron
0 * * * * root /root/syslogcron/cleanimf.sh 2>&1
- Start the rsyslog daemon
systemctl start syslog.socket rsyslog.service