Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify logrotate schema #163

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions defaults/etc/logrotate.d/00_defaults
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
maxsize 250k

/var/log/logrotate/*.log {
rotate 7
daily
compress
copytruncate
size 100k
nocreate
missingok
notifempty
delaycompress
}
maxsize 250k
1 change: 1 addition & 0 deletions defaults/etc/logrotate.d/emoncms
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
compress
olddir /var/log.old/emoncms
createolddir 775 root root
renamecopy
}
2 changes: 1 addition & 1 deletion defaults/etc/logrotate.d/emoncms-non-emonsd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
daily
compress
copytruncate
size 100k
size 3M
nocreate
missingok
notifempty
Expand Down
6 changes: 1 addition & 5 deletions defaults/etc/logrotate.d/emonhub
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/var/log/emonhub/emonhub.log {
maxsize 3M

norenamecopy
copytruncate
su root root
compress

olddir /var/log.old/emonhub
createolddir 775 root root
renamecopy
}
9 changes: 9 additions & 0 deletions defaults/etc/logrotate.d/logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/var/log/logrotate/*.log {
rotate 7
daily
compress
nocreate
missingok
notifempty
delaycompress
}
2 changes: 2 additions & 0 deletions install/emonsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ fi
sudo ln -sf $openenergymonitor_dir/EmonScripts/defaults/etc/logrotate.d/00_defaults /etc/logrotate.d/00_defaults
sudo ln -sf $openenergymonitor_dir/EmonScripts/defaults/etc/logrotate.d/emonhub /etc/logrotate.d/emonhub
sudo ln -sf $openenergymonitor_dir/EmonScripts/defaults/etc/logrotate.d/emoncms /etc/logrotate.d/emoncms
sudo ln -sf $openenergymonitor_dir/EmonScripts/defaults/etc/logrotate.d/logrotate /etc/logrotate.d/logrotate

sudo chown root /etc/logrotate.d/00_defaults
sudo chown root /etc/logrotate.d/emonhub
sudo chown root /etc/logrotate.d/emoncms
sudo chown root /etc/logrotate.d/logrotate

# log2ram cron hourly entry
sudo ln -sf $openenergymonitor_dir/EmonScripts/defaults/etc/cron.hourly/log2ram /etc/cron.hourly/log2ram
Expand Down