borgbackup. create a backup with specific name that is cycled at size 3

borgbackup create backup specific name cycle size limit 3

Refined the query by clarifying terms like 'cycle' and 'size limit' for better specificity, which should help in retrieving more relevant documentation and examples related to using BorgBackup for cyclical backups.

To create a backup using BorgBackup with a specific name that cycles when the size limit reaches three archives, you can follow a structured approach. Below, I’ll provide an overview of BorgBackup and guide you through the necessary commands and configurations.

Introduction to BorgBackup

BorgBackup (or simply Borg) is a versatile deduplicating backup program that efficiently compresses your data, stores it securely, and supports authenticated encryption. It is designed for flexibility and performance, making it a popular choice for both personal and professional use.

Creating a Backup Archive with Borg

Step 1: Install BorgBackup

Before you can create backups, ensure that BorgBackup is installed on your system. If it’s not already installed, you can usually do so via package managers on Linux, or by following instructions for your operating system from the BorgBackup documentation.

Step 2: Initialize a Repository

You need to create a backup repository where your backups will be stored. Run the following command to initialize your repository:

borg init /path/to/your/repository

Replace /path/to/your/repository with the actual path where you want to store your backups.

Step 3: Create a Backup Archive

To create a backup with a specific name, you can use the following command:

borg create --progress /path/to/your/repository::archive-name /path/to/files/to/backup

Here, replace archive-name with your desired name and /path/to/files/to/backup with the actual files or directories you wish to backup.

Step 4: Implementing Size Limiting and Cycling

To cycle through backups when the number of archives exceeds three, you need to use a combination of borg prune command. Here’s how to manage this:

  1. Create a Cron Job (optional): If you want the backups to run automatically at specified intervals, you might consider setting up a cron job. Edit your crontab with:

    crontab -e
    
  2. Add Pruning Logic: Use the borg prune command to keep only the last three backups. This command should be run after your backup command. The following command will keep the last three archives:

    borg prune --prefix 'archive-name-' --keep-last 3 /path/to/your/repository
    

Here’s a full command sequence grouped together:

borg create --progress /path/to/your/repository::archive-name-$(date +%Y-%m-%d_%H-%M-%S) /path/to/files/to/backup
borg prune --prefix 'archive-name-' --keep-last 3 /path/to/your/repository

Explanation of Command Components:

  • borg create: This command creates a new backup archive.
  • --progress: Shows the backup progress in the terminal.
  • $(date +%Y-%m-%d_%H-%M-%S): Appends a timestamp to the archive name for uniqueness.
  • borg prune: Removes old archives based on the specified rules.
  • --prefix 'archive-name-': Targets only archives starting with the defined prefix.
  • --keep-last 3: Deletes older archives, retaining only the last three.

Step 5: Verify Your Backups

After running the commands, it’s wise to verify that your backups are created successfully. You can list all of your archives with:

borg list /path/to/your/repository

This command displays the names of all archives in your repository, allowing you to confirm that your most recent backups are available.

Conclusion

By following the steps outlined above, you can effectively create and manage backups using BorgBackup while maintaining a cycle of the last three archives. This method not only conserves storage space but also ensures that you retain recent backups for quick recovery. For additional details or advanced configurations, you may refer to the comprehensive BorgBackup documentation, which provides insights into its capabilities and options.

Feel free to ask if you have any specific questions or need further assistance!

People Also Ask

Related Searches

Sources

10
1
General — Borg - Deduplicating Archiver 1.4.1 documentation
Borgbackup

Long file names · At least three directory levels with short names · Typically, file sizes up to a few hundred MB. · Up to 1000 files per directory.

2
Quick Start — Borg - Deduplicating Archiver 1.4.1 documentation
Borgbackup

A Borg archive is the result of a single backup ( borg create ). An archive stores a snapshot of the data of the files “inside” it.

3
Repo size limit : r/BorgBackup - Reddit
Reddit

Around 1 TB is a good size I think. After that I'd split it by data type and maybe play with compression settings.

4
Backups over multiple volumes · Issue #4896 · borgbackup/borg
GitHub

A fundamental limit of borg is that it is located to a single position in your file system and to a single backup medium. So when the backup medium is full, it ...

5
borg(1) — borgbackup — Debian testing
Manpages

BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption.

6
borg: BorgBackup is a deduplicating backup program with optional ...
Mankier

BorgBackup is a deduplicating backup program with optional compression and authenticated encryption.

7
Borg Backup: an introduction - Luca Ferrari
Fluca1978

borg is a command line tool to do backups. It has a few itneresting features, most notably: How can borg do the deduplication?

8
borg-compression(1) — borgbackup — Debian testing
Manpages

If you do not explicitly give the compression level L (ranging from 1 to 22), it will use level 3. Archives compressed with zstd are not ...

9
Command-line reference - torsion.org projects
Torsion

Here are all of the available borgmatic command-line flags for the most recent version of borgmatic, including the separate flags for each action (sub-command).

10
How BorgBackup works and User Guide for BorgBackup
Itsfoss

BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated encryption.