]> pd.if.org Git - zpackage/blob - doc/zpm-gc.8
remove stray debug fprintf
[zpackage] / doc / zpm-gc.8
1 .TH zpm-gc 8 2018-12-10 "ZPM 0.4"
2 .SH NAME
3 zpm-gc \- garbage collect a database
4 .SH SYNOPSIS
5 .B zpm gc [-f \fIdb\fB] [-cCP] [-l retention] [-n retention]
6 .SH DESCRIPTION
7 \fBzpm-gc\fR removes unneeded or unwanted elements from a zpm database.
8 Actions taken will be logged in the database and written to stdout.
9 Each action is described below.
10 .SS Old packages
11 Unused packages will be removed, unless they need to be retained to keep a
12 library installed, or if they are within the keep target.  By default, two old
13 versions of a package will be kept.  This phase is run by default,
14 but can be suppressed with the \-P option.  The keep target can
15 be set with the -k option or the ZPM_KEEP_PACKAGES environment
16 variable.  If both are used, the command line option takes precedence.
17 .PP
18 Packages kept by the keep target do not include packages otherwise retained for
19 library dependencies, so it is possible that more than the keep target older
20 packages will be retained.  Only packages in an "updated" or "removed" status
21 are eligible for garbage collection, so an admin can keep any arbitrary package
22 from being garbage collected by setting the status of the package to some other
23 value.
24 .SS Log entries
25 Old log entries can be removed by passing the \-l option.  The -l
26 option takes an argument specifying which log entries to delete.
27 .SS Notes
28 Notes can be removed with the \-n option.
29 .SS Unreferenced file content
30 File content unreferenced by either a package, note, or script
31 will be removed by default.  This action can be suppressed with \-C.
32 .SS Package file content
33 File content belonging to packages can be removed with the \-F option.
34 This is not done by default, and the action can be restricted to
35 a specific package with the \-p option.
36 .SS Compact
37 Re-write the database file out completely to minimize the amount
38 of disk space it uses.  This option can take a few minutes
39 for large (gigabyte sized) databases, and is not run by default.
40 It can be enabled with the \-c option.
41 .SH OPTIONS
42 .TP
43 \-f \fIdbfile\fR
44 Use \fIdbfile\fR as the database to run against, instead of the default.
45 .TP
46 \-l \fIretention\fR
47 Delete old logentries that correspond to the retention.
48 A retention starting with a '+' is taken as the number of days to retain.
49 A retention containing only digits is taken as a number of log entries to
50 retain, anything else is interpreted as a timestamp.
51 .TP
52 \-n \fIretention\fR
53 Delete old notes that correspond to the retention.
54 A retention is interpreted the same way as for the \-l option.
55 .TP
56 \-z
57 Zero out the set of actions to preform.
58 Specific actions can be specified as options after the \-z.
59 .TP
60 \-k \fIn\fR
61 Set the number of old packages to retain to \fIn\fR.  These are in addition to
62 any packages retained because they contain libraries that are still needed.
63 .SH EXAMPLES
64 .PP
65 .nf
66 zpm-gc
67 .fi
68 .SH EXIT STATUS
69 0 if successful, non-zero if there was an error
70 .SH FILES
71 None
72 .SH ENVIRONMENT
73 ZPMDB ZPM_KEEP_PACKAGES
74 .SH AUTHOR
75 Nathan Wagner
76 .SH SEE ALSO
77 .BR zpm (8)
78 .BR zpm-log (8)