New logrotate

This commit is contained in:
phahulin 2017-11-01 21:40:12 +03:00 committed by GitHub
parent 4a86366d97
commit 305dfe5714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -409,7 +409,7 @@ EOF"
configure_logrotate() {
echo "=====> configure_logrotate"
sudo bash -c "cat > /etc/logrotate.d/oracles.conf << EOF
sudo bash -c "cat > /home/${ADMIN_USERNAME}/oracles-logrotate.conf << EOF
/home/${ADMIN_USERNAME}/logs/*.log {
rotate 10
size 200M
@ -420,6 +420,7 @@ configure_logrotate() {
dateformat %Y-%m-%d-%s
olddir old
}
/home/${ADMIN_USERNAME}/.pm2/pm2.log {
su ${ADMIN_USERNAME} ${ADMIN_USERNAME}
rotate 10
@ -431,6 +432,13 @@ configure_logrotate() {
dateformat %Y-%m-%d-%s
}
EOF"
sudo bash -c "cat > /etc/cron.hourly/oracles-logrotate <<EOF
#!/bin/bash
/usr/sbin/logrotate /home/${ADMIN_USERNAME}/logrotate.conf
EOF"
sudo chmod 755 /etc/cron.hourly/oracles-logrotate
echo "<===== configure_logrotate"
}