NixOS Generations Trimmer: Difference between revisions

imported>Mike1
m New defaults
imported>Mike1
m New confirm option added
 
Line 23: Line 23:
<syntaxHighlight lang=bash>
<syntaxHighlight lang=bash>
❯ ./trim-generations.sh     
❯ ./trim-generations.sh     
The current defaults are:
Keep-Gens=30 Keep-Days=30
Keep these defaults? (y/n):y
Using defaults..
Keeping default: 30 generations OR 30 days, whichever is more
Keeping default: 30 generations OR 30 days, whichever is more
Operating on profile: /nix/var/nix/profiles/per-user/user/profile
Operating on profile:   /nix/var/nix/profiles/per-user/dougal/profile
 
oldest generation:            75
oldest generation created:    2023-08-05
minutes before now:            46740
hours before now:              779
days before now:              32
 
current generation:            217
current generation created:    2023-09-06
minutes before now:            660
hours before now:              11
days before now:              0


oldest generation:            27
        Something to do...
oldest generation created:    2021-09-24
minutes before now:            3918
hours before now:              65
days before now:              2


current generation:           33
Found the following generation(s) to delete:
current generation created:   2021-09-25
generation 75    2023-08-05, 32 day(s) old
generation 76    2023-08-05, 32 day(s) old
generation 77    2023-08-05, 32 day(s) old
generation 78    2023-08-05, 32 day(s) old
generation 79    2023-08-05, 32 day(s) old
generation 80    2023-08-05, 32 day(s) old
generation 81    2023-08-05, 32 day(s) old
generation 82    2023-08-05, 32 day(s) old
generation 83    2023-08-05, 32 day(s) old
generation 84    2023-08-05, 32 day(s) old
generation 85    2023-08-05, 32 day(s) old
generation 86   2023-08-05, 32 day(s) old


All generations are no more than 30 days older than current generation.
Do you want to delete these? [Y/n]:  
Oldest gen difference from current gen: 1


Nothing to do!
</syntaxHighlight>
</syntaxHighlight>