Closed BradleyA closed 5 years ago
sudo vi /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
# weekly
daily
# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
# su root syslog
su root syslog uadmin
# keep 4 weeks worth of backlogs
# rotate 4
rotate 32
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
compress
. . .
move logrotate files (status, pi-display) into /usr/local/data/us-tx-cluster-1/logrotate
test with the following command, it works!!!
/usr/sbin/logrotate -s /usr/local/data/us-tx-cluster-1/logrotate/status /usr/local/data/us-tx-cluster-1/logrotate/pi-display
add line in crontab
mail log sudo apt install mailutils echo test | /usr/bin/mail -s 'incident report six-rpi3b.cptx86.com-crontab' allen.bradley@ymail.com /usr/bin/mail -s 'incident report six-rpi3b.cptx86.com-crontab' allen.bradley@ymail.com < incident did not work, black listed mail -s 'incident report six-rpi3b.cptx86.com-crontab' l0s5r0u1x1l9h3m1@cptx86.slack.com < incident
sudo ls
cd
sudo rm -rf /usr/local/data
cd /usr/local/bin ; rm create-host-info.sh create-display-message.sh cpu-temperature.sh CPU_usage.sh display-led.py display-message-hd.py display-message.py display-led-test.py display-scrollphathd-test.py display-scrollphat-test.py
sudo rm /var/spool/cron/crontabs/uadmin
cd ~/github/BradleyA/
rm -rf pi-display/
git clone https://github.com/BradleyA/pi-display
cd pi-display/
sudo ./setup-pi-display.sh us-tx-cluster-1 /usr/local/data uadmin uadmin allen.bradley@ymail.com
crontab -e
sudo view /var/spool/cron/crontabs/uadmin
cd /usr/local/data/us-tx-cluster-1/logrotate
/usr/sbin/logrotate -s /usr/local/data/us-tx-cluster-1/logrotate/status /usr/local/data/us-tx-cluster-1/logrotate/pi-display-logrotate
sudo ls
cd
cd ~/github/BradleyA/
git clone https://github.com/BradleyA/pi-display
cd pi-display/
sudo ./setup-pi-display.sh us-tx-cluster-1 /usr/local/data uadmin uadmin allen.bradley@ymail.com
cd
crontab -e
cd /usr/local/data/us-tx-cluster-1/logrotate
log data filling disk space - logrotate for log files