From f32fef1b075f63ecf8c7351c5e67d4dd95c0fb80 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 17 Sep 2008 14:52:35 +0000 Subject: * GC option `--max-atime' that specifies an upper limit to the last accessed time of paths that may be deleted. Anything more recently used won't be deleted. The time is specified in time_t, e.g. seconds since 1970-01-01 00:00:00 UTC; use `date +%s' to convert to time_t from the command line. Example: to delete everything that hasn't been used in the last two months: $ nix-store --gc -v --max-atime $(date +%s -d "2 months ago") --- src/libstore/store-api.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libstore/store-api.cc') diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index c9b6fb95955d..23631a3b8e9c 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -15,6 +15,7 @@ GCOptions::GCOptions() maxFreed = ULLONG_MAX; maxLinks = 0; useAtime = false; + maxAtime = (time_t) -1; } -- cgit 1.4.1