Borgbackup

Discussion in 'all things UNIX' started by summerheat, Jun 16, 2017.

  1. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
    Has anybody tried Borgbackup? (Their github site is here.) I've been using it for several weeks - and it looks really great.

    Borgbackup has several interesting features, some of them are:
    • It uses deduplication which makes it very space efficient
    • It uses compression (lz4, zlib or lzma) which reduces space requirements even more
    • It encrypts the backups with AES 256-bit
    Its usage seems to be a bit cryptic at first (there is a GUI which I haven't tried, though). However, it's not really a problem. The basics are explained here. You have to initialize a backup repo first. The backups are then preferably performed by executing a file which I saved as borgbackup in ~/bin. In my case it looks like this:

    Code:
    #!/bin/sh
    if ! kdialog --warningcontinuecancel 'Is external hard disk mounted?'; then
    exit;
    fi
    
    REPOSITORY=/run/media/heat/74a226b3-bb6a-4217-97ec-76769e4f3884/Borgbackup
    
    # Backup /home and some directories in /media except a few
    # excluded directories
    borg create -v --stats --compression lz4        \
        $REPOSITORY::'{hostname}-{now:%Y-%m-%d}'    \
        /home/heat                                    \
        /media/Multimedia/Pictures                     \
        /media/Multimedia/sandbox                    \
        /media/Multimedia/Keyboard-Register          \
        --exclude '/home/heat/.cache'                  \
        --exclude /home/heat/VirtualBox\ VMs
    
    # Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
    # archives of THIS machine. The '{hostname}-' prefix is very important to
    # limit prune's operation to this machine's archives and not apply to
    # other machine's archives also.
    borg prune -v --list $REPOSITORY --prefix '{hostname}-' \
        --keep-daily=7 --keep-weekly=4 --keep-monthly=6
    The first backup needs some time but subsequent runs are much faster. (Note that the kdialog line is only applicable if you're using KDE - there are similar solutions for other DEs.)

    In order to browse the backup archive or to restore individual files from it the borg mount command is used. So I created the following borgmount file:

    Code:
    borg mount /run/media/heat/74a226b3-bb6a-4217-97ec-76769e4f3884/Borgbackup /home/heat/Borg
    ... and a corresponding borgumount file:

    Code:
    borg umount /home/heat/Borg
    Once those files (particularly the first one) are created Borgbackup usage is very easy. Just execute borgbackup - that's it.

    The only thing that worries me a bit is what the authors write on their github site:

    I'll have to see if this will really be a problem and if the authors will provide a migration method from old versions to new ones if required.
     
  2. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,226
    Why not go with tools that have years of proven usage and more consideration to user needs?
    Mrk
     
  3. Peter2150

    Peter2150 Global Moderator

    Joined:
    Sep 20, 2003
    Posts:
    20,590

    I agree 100%
     
  4. NormanF

    NormanF Registered Member

    Joined:
    Feb 20, 2009
    Posts:
    2,882
    No need to use the command line.

    There are other backup tools available on Linux that much more user-friendly.
     
  5. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
    Yes, why not? IMO Borg is interesting because of those features mentioned above. And I didn't mention one advantage: While, e.g., rsync can also use deduplication via hard links, Borg works differently:
    This is a great feature if you backup large files like Virtualbox images etc. Such backups are very fast and efficient. I'm not aware of alternatives which are able to do this.

    Can you recommned other backup programmes with equivalent features out of the box?
     
  6. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
    As I wrote in the first post, there is a GUI which I haven't tried, though.

    Besides, modifying above script to your needs takes 2 minutes at most. From then on you just have to execute borgbackup. It's that easy.
     
  7. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,226
    Yes, rsync. In the end, you will be restricted by your disk/network - not the copying/dedup algorithms.
    And even if takes longer, reliability is the most important thing in backups.
    Mrk
     
  8. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
    Yes, agreed. On the other hand, Borgbackup is not a new program - its developmnet started in 2015 as a fork of Attic which has existed since 2013. And from what I've read in various forums from Borg users it seems to be reliable.
     
  9. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,226
    Is it used by thousands of organizations for data backup? Unlikely.
    As cruel as it sounds, it's YOUR data. You want the absolutely most reliable tool.
    Mrk
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.