borg Command Examples (Deduplicating backup tool)

Borg is a deduplicating backup tool that provides a reliable and efficient solution for creating backups of your data. It is designed to handle both local and remote backups, allowing you to store your backups on local storage devices or on remote servers.

Here are the key features and aspects of Borg:

  • Deduplication: Borg employs deduplication techniques to minimize the amount of storage space required for backups. Deduplication means that only unique data chunks are stored, and duplicate data is referenced to the existing chunks. This significantly reduces the storage space needed for backups, especially when multiple backups share common files or data.
  • Backup Creation: Borg allows you to create backups of directories and files on your system. You can specify the directories or files you want to include in the backup, and Borg will handle the process of compressing, encrypting, and storing the data. The backups created by Borg are incremental, meaning that only the changes since the last backup are stored, resulting in faster backup times and reduced storage requirements.
  • Backup Integrity: Borg ensures the integrity of your backups through the use of cryptographic checksums. Each data chunk is assigned a unique hash value, which is used to verify the integrity of the data during backup creation and restoration. This ensures that your backups are free from corruption and that the data can be reliably restored when needed.
  • Mountable Backups: Borg allows you to mount your backups as filesystems, providing easy access to the backed-up data. This means that you can browse and access the contents of your backups directly, as if they were mounted as a regular filesystem. This feature is particularly useful when you need to retrieve specific files or folders from your backups without having to restore the entire backup.
  • Encryption and Security: Borg supports encryption of your backups to protect sensitive data. You can encrypt your backups using strong encryption algorithms, ensuring that your data remains secure and confidential. This is especially important when storing backups on remote servers or in cloud storage, as it prevents unauthorized access to your data.
  • Remote Backups: Borg allows you to create backups on remote servers or storage devices. This enables you to store your backups in off-site locations, providing an additional layer of data protection. You can use various protocols such as SSH or SFTP to securely transfer your backups to remote destinations.
  • Compression and Performance: Borg incorporates compression algorithms to reduce the size of the stored data, further optimizing storage space and backup times. The compression level can be adjusted according to your requirements, balancing between backup size and performance.
  • Easy Backup Management: Borg provides a command-line interface (CLI) for managing backups. It offers a range of commands and options to create, restore, and manage your backups efficiently. The CLI interface allows for scripting and automation, enabling you to integrate Borg into your backup workflows and scheduled tasks.

borg Command Examples

1. Initialize a (local) repository:

# borg init /path/to/repo_directory

2. Backup a directory into the repository, creating an archive called “Monday”:

# borg create --progress /path/to/repo_directory::Monday path/to/source_directory

3. List all archives in a repository:

# borg list /path/to/repo_directory

4. Extract a specific directory from the “Monday” archive in a remote repository, excluding all *.ext files:

# borg extract user@host:/path/to/repo_directory::Monday /path/to/target_directory --exclude '*.ext'

5. Prune a repository by deleting all archives older than 7 days, listing changes:

# borg prune --keep-within 7d --list path/to/repo_directory

6. Mount a repository as a FUSE filesystem:

# borg mount /path/to/repo_directory::Monday /path/to/mountpoint

7. Display help on creating archives:

# borg create --help

Summary

In summary, Borg is a deduplicating backup tool that offers efficient and secure backup solutions. It utilizes deduplication techniques to reduce storage requirements, supports encryption for data security, allows backups to be mounted as filesystems for easy access, and enables both local and remote backup storage options. With its comprehensive features and flexible backup management capabilities, Borg provides a reliable solution for protecting and managing your data backups.

Related Post