# Has /var/log Filling up Been Fixed?

**URL:** <https://community.openenergymonitor.org/t/has-var-log-filling-up-been-fixed/10985>\
**Category:** Emoncms\
**Tags:** emonpi\
**Created:** [22 May 2019 11:08 UTC](https://community.openenergymonitor.org/t/has-var-log-filling-up-been-fixed/10985 "2019-05-22T11:08:09Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [24 May 2019 10:29 UTC](https://community.openenergymonitor.org/t/has-var-log-filling-up-been-fixed/10985/13 "2019-05-24T10:29:36Z")

</div>

@TrystanLea - If you check Neils update logs they both contain

```auto
Installing emoncms logrotate...

Now setting up Logrotate...
Backing up old logrotate configuration...
Linked to new logrotate configuration...
Backing up old logrotate cron job...
mv: cannot stat '/etc/cron.daily/logrotate': No such file or directory
Linked to new logrotate cron job...

Completed

Completed

Running logrotate...

set log rotate config owner to root

```

the 2 "Backing up old . . . " lines suggest the backed up files are being over written on every update, there no point backing up the original files if they are going to be overwritten again with the content of the symlinked files, ideally this needs to be multi-run safe by making a backup only if a real file is found (not a symlink) as I proposed

> [@/var/log still filling up](https://community.openenergymonitor.org/t/var-log-still-filling-up/10921/27):
>
> I’ve looked through the logrotate install/update and it seems to be currently complete (as intended on previous emonSD images but absent on the Oct2018 image) but I wonder about how “multi-run safe” that script would be, surely the backed up files will get overwritten on every run as symlinks will pass the `-f` test. Also there is some confusion around the hourly vs daily cron (linking then moving?) so I was going to propose these changes [Comparing master...logrotate · emoncms/emoncms · GitHub](https://github.com/emoncms/emoncms/compare/logrotate?expand=1) which will backup either daily or hourly cron files (but not symlinked copies) and forces a new cron symlink, just in case an existing incorrect symlink blocks a correct one being written.

> **[Comparing master...logrotate · emoncms/emoncms](https://github.com/emoncms/emoncms/compare/logrotate?expand=1)**
>
> Web-app for processing, logging and visualising energy, temperature and other environmental data - Comparing master...logrotate · emoncms/emoncms

I also think the whole update should be aborted if the emonpi repo git pull fails and failures need to be passed to the user somehow. Perhaps a flag “there were errors check your update log” could be bannered across the emoncms gui and or on the emonpi lcd?

---

_[View the full topic](https://community.openenergymonitor.org/t/has-var-log-filling-up-been-fixed/10985)._
