diff options
author | Aaron L. Zeng <me@bcc32.com> | 2023-01-29 00:24:25 -0500 |
---|---|---|
committer | Aaron L. Zeng <me@bcc32.com> | 2023-01-29 00:24:25 -0500 |
commit | b90cf0612e5963849d0dfe22e95debe834e9abde (patch) | |
tree | cce5b36e1343d816877bf90c9f1d08aa37505398 | |
parent | 67bb3784f22eaa3a94a0121eedb47092522feed6 (diff) | |
download | nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.tar nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.tar.gz nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.tar.bz2 nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.tar.lz nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.tar.xz nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.tar.zst nixpkgs-b90cf0612e5963849d0dfe22e95debe834e9abde.zip |
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!
-rw-r--r-- | nixos/modules/programs/atop.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/programs/atop.nix b/nixos/modules/programs/atop.nix index 2b14d7c7343..329dd9ccd62 100644 --- a/nixos/modules/programs/atop.nix +++ b/nixos/modules/programs/atop.nix @@ -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 ''; |