Can anybody give me a hint on how to setup a logrotate for fetchmail?
Code:
/var/log/fetchmail { In my case this would be /var/log/fetchmaillog
weekly
rotate 5
compress
missingok
notifempty
create 640 fetchmail root Again in my case this would be create 600 fetchmaillog root
sharedscripts
postrotate
if [ -f /var/run/fetchmail/fetchmail.pid ]; then \ again in my case ist would be /var/run/fetchmail.pid
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d fetchmail restart > /dev/null; \
else \
/etc/init.d/fetchmail restart > /dev/null; \
fi; \
fi;
endscript
}
So this
is from a debian system. But I am running CentOS 5.1 x86 i386.
I guess that after this
the script performs a restart of fetchmail so.
Can I just apply this to me needs like if.... instead of /usr/sbin/invoke-rc.d to write /usr/bin fetchmail and so on ...
Another thing is that my mails get catched by a cron job like this
Code:
/usr/bin/fetchmail -v -k -L /var/log/fetchmaillog -f '/root/.fetchmailrc' >/dev/null 2>&1
the
is only cause I don't want to have always a mail sent to root afterwards.
So if I would rewrite the script above and then if a pid exists etc.. and I start /usr/bin/fetchmail I guess I will have to attach all those -v -k -L as well ?