Forrest logo
back to the restic tool

restic:tldr:d1f1d

restic: Clean up the repository and keep only the most recent snapshot of each unique backup.
$ restic forget --keep-last 1 --prune
try on your machine

The command restic forget --keep-last 1 --prune is used in the restic backup tool to manage backups and clean up unnecessary data.

Here is a breakdown of the command and its options:

  • restic: It is the command-line tool used to interact with the restic backup system.

  • forget: It is a command within restic used to control the retention of backups. It allows you to specify rules for keeping or forgetting backups.

  • --keep-last 1: This option specifies that only the most recent backup should be kept. In other words, restic will remove all but the latest backup, regardless of other rules.

  • --prune: This option tells restic to perform a cleanup operation after forgetting backups. The prune command removes data that is no longer referenced by any backup. It helps to reclaim disk space by permanently deleting unreferenced data.

To summarize, the restic forget --keep-last 1 --prune command is used to forget all backups except the latest one and then clean up any unreferenced data to optimize disk space usage.

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 restic tool