Rm

Removes files and directories from a backup.

$ hb rm [-c backupdir] [-r version] path1 path2 ...
                       [--secure] [--excluded]

Without options, all versions of the files listed are removed from the backup. Only root or the owner of a version (the userid that created the backup version) can remove files from that version.

Pathnames must be complete as shown in a listing of the backup, beginning with a slash. For safety reasons, wildcards cannot be used with the rm command, but entire directories can be removed. There is no extra confirmation when removing directories. The root path (/) cannot be removed.

Options

-r removes files from a specific version.

--secure forces immediate packing of all arc files affected by this rm, ignoring any pack- config options and limits, so that deleted data blocks are physically deleted from the backup. This is usually not necessary since rm deletes the recipe for reconstructing a file, making it impossible to restore, but it can be useful when confidential data is removed to ensure that even the encrypted data blocks are removed from the backup. It is most efficient to do all secure removals in one command line to avoid repacking arc files more than once.

If files are removed without --secure, it is not possible to remove them later with --secure because the recipe relating blocks to files has been removed from the database.

--excluded removes files in the backup that should have been excluded according to inex.conf. This could happen because of a bug in backup’s exclude processing, an excluded file could be listed on the backup command line, or a file could be backed up first and then excluded later. --excluded can be combined with other rm options.

While wildcards are not permitted on the rm command line, they are usually present in the inex.conf file and will be used by the --excluded option to remove files. It is recommended to run ls --excluded -ad first to see which files will be removed.

Space Recovery

HashBackup tries to strike a good balance between bandwidth and storage efficiency. When half of the data in an archive file has been deleted with rm or retain, the archive file is packed to recover the deleted space and all destinations are updated. This is controlled with the pack-percent-free and other pack- config options. Check the config command pack options for more details.