Source

Useful links

Doing the thing

logrotate must be run with sudo (location: /usr/sbin/logrotate)

relevant paths:

# main configuration file
/etc/logrotate.conf
 
# configuration files for specific log files
/etc/logrotate.d/*
 
# cronjob
/etc/cron.daily/logrotate
# /etc/cron.daily/logrotate
 
#!/bin/sh
 
# skip in favour of systemd timer
if [ -d /run/systemd/system ]; then
    exit 0
fi
 
# this cronjob persists removals (but not purges)
if [ ! -x /usr/sbin/logrotate ]; then
    exit 0
fi
 
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit $EXITVALUE

journalctl

show logs of a particular priority level (lower number = more critical)

journalctl --priority={1,2,3,4,5,6,7}

mailutils

check log of errored mail

cat /var/spool/mail/user

enable sending mail to outside world (using exim4)

# /etc/exim4/update-exim4.conf.conf
 
...
dc_eximconfig_configtype='internet'
dc_other_hostnames='vimoire.com'
...
 
sudo systemctl restart exim4

change hostname with hostnamectl

sudo hostnamectl set-hostname vimoire.com

test sending mail

echo "Message content" | mail -s "Subject line" user@example.com

EOF