Forrest logo
back to the borg tool

borg:tldr:0e248

borg: Prune a repository by deleting all archives older than 7 days, listing changes.
$ borg prune --keep-within ${7d} --list ${path-to-repo_directory}
try on your machine

The command is using the borg prune command to prune (delete) unnecessary backups from a Borg backup repository.

Here is the breakdown of the command:

  • borg prune: This is the main command to execute the Borg pruning operation.
  • --keep-within ${7d}: This flag specifies the time period within which the backups should be kept. In this case, it is set to 7d, which means to keep backups that are within the last 7 days.
  • --list: This flag tells Borg to list the archives that would be pruned without actually deleting them. It allows you to preview the backups that would be removed.
  • ${path-to-repo_directory}: This is the path to the Borg backup repository directory. You need to replace ${path-to-repo_directory} with the actual path to the directory where your Borg backups are stored.

To clarify, this command will list the backups within the last 7 days that would be pruned from the specified Borg backup repository, without actually deleting them.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the borg tool