mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 15:56:50 +01:00
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!
This commit is contained in:
parent
67bb3784f2
commit
b90cf0612e
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue