Commit b90cf061 authored by Aaron L. Zeng's avatar Aaron L. Zeng
Browse files

nixos/atop: Remove upgraded logfiles if not replaced

Before this change, starting atop regularly caused a quadratic
increase in the number of log files over time, as each daily log file
was copied (multiple times) to a new file, and then left there because
the upgrade was a no-op.  This eventually led to atop being unable to
start because the log file name became too long!
parent 67bb3784
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -150,6 +150,8 @@ in
                  if ! ${pkgs.diffutils}/bin/cmp -s "$logfile" "$logfile".new
                  then
                    ${pkgs.coreutils}/bin/mv -v -f "$logfile".new "$logfile"
                  else
                    ${pkgs.coreutils}/bin/rm -f "$logfile".new
                  fi
                done
              '';