| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 | .\" Man page generated from reStructuredText....nr rst2man-indent-level 0..de1 rstReportMargin\\$1 \\n[an-margin]level \\n[rst2man-indent-level]level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]-\\n[rst2man-indent0]\\n[rst2man-indent1]\\n[rst2man-indent2]...de1 INDENT.\" .rstReportMargin pre:. RS \\$1. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]. nr rst2man-indent-level +1.\" .rstReportMargin post:...de UNINDENT. RE.\" indent \\n[an-margin].\" old: \\n[rst2man-indent\\n[rst2man-indent-level]].nr rst2man-indent-level -1.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]].in \\n[rst2man-indent\\n[rst2man-indent-level]]u...TH "BORG-COMPACT" "1" "2025-06-18" "" "borg backup tool".SH NAMEborg-compact \- Collect garbage in repository.SH SYNOPSIS.spborg [common options] compact [options].SH DESCRIPTION.spFree repository space by deleting unused chunks..spborg compact analyzes all existing archives to find out which repositoryobjects are actually used (referenced). It then deletes all unused objectsfrom the repository to free space..spUnused objects may result from:.INDENT 0.0.IP \(bu 2borg delete or prune usage.IP \(bu 2interrupted backups (maybe retry the backup first before running compact).IP \(bu 2backup of source files that had an I/O error in the middle of their contentsand that were skipped due to this.IP \(bu 2corruption of the repository (e.g. the archives directory having lostentries, see notes below).UNINDENT.spYou usually don\(aqt want to run \fBborg compact\fP after every write operation, buteither regularly (e.g. once a month, possibly together with \fBborg check\fP) orwhen disk space needs to be freed..sp\fBImportant:\fP.spAfter compacting it is no longer possible to use \fBborg undelete\fP to recoverpreviously soft\-deleted archives..sp\fBborg compact\fP might also delete data from archives that were \(dqlost\(dq due toarchives directory corruption. Such archives could potentially be restored with\fBborg check \-\-find\-lost\-archives [\-\-repair]\fP, which is slow. You thereforemight not want to do that unless there are signs of lost archives (e.g. whenseeing fatal errors when creating backups or when archives are missing in\fBborg repo\-list\fP)..spWhen giving the \fB\-\-stats\fP option, borg will internally list all repositoryobjects to determine their existence AND stored size. It will build a freshchunks index from that information and cache it in the repository. For sometypes of repositories, this might be very slow. It will tell you the sum ofstored object sizes, before and after compaction..spWithout \fB\-\-stats\fP, borg will rely on the cached chunks index to determineexisting object IDs (but there is no stored size information in the index,thus it can\(aqt compute before/after compaction size statistics)..SH OPTIONS.spSee \fIborg\-common(1)\fP for common options of Borg commands..SS options.INDENT 0.0.TP.B  \-n\fP,\fB  \-\-dry\-rundo nothing.TP.B  \-s\fP,\fB  \-\-statsprint statistics (might be much slower).UNINDENT.SH EXAMPLES.INDENT 0.0.INDENT 3.5.sp.EX# compact segments and free repo disk space$ borg compact.EE.UNINDENT.UNINDENT.SH SEE ALSO.sp\fIborg\-common(1)\fP.SH AUTHORThe Borg Collective.\" Generated by docutils manpage writer..
 |