I was doing a lot of work in my Solus home directory recently and decided it needed more frequent backups. Instead of going to my usual tar
backup procedure, I decided to try borg
as it seemed to make more sense to use incrementals when things are changing rapidly.
So I installed borg
in Solus, and setup a dedicated borg repository area on a 2Tb USB backup drive. The area automounted as /run/media/nevj/Borg
I decided to make a repository just for Solus backups inside that so
# cd /run/media/nevj/Borg # mkdir Solus
Then I initialised a repository
# borg init --encryption=none /run/media/nevj/Borg/Solus
and created a backup of /home/nevj
#cd ~nevj #borg create /run/media/nevj/Borg/Solus::home-{now} .
Note the dot
The backup goes into an archive
named by the stuff after the ::
Borg can list all the archives in a repo
#borg list /run/media/nevj/Borg/Solus home-2022-07-02T17:02:17 Sat, 2022-07-02 17:02:17 [41e6e90a72984a217ea783d54fc7aa7f4c1b3c977e99c310d332d83655660643]
So I have one archive called home-2022-07-02T17:02:17
I needed to test file recovery so
#cd #mkdir tmp #cd tmp
So I will recover to a subdir called tmp
#borg extract /run/media/nevj/Borg/Solus::home-2022-07-02T17:02:17 #ls borgtmp Downloads Shared update20220611.out common Music solusupgrades.txt Vboxaids dawn packages Templates Videos Desktop Pictures ud140222a.out 'VirtualBox VMs' Documents Public ud140222.out downloadhelper Recipes update20220411.out #
and all the files come back.
You can retrieve files selectively by name. I tried that too.
So I am using borg
OK in a very simple case.
But there are questions?
- What if I now use
borg
from another Linux version - lets say Debian. It will probably be a different version ofborg
. My gut feeling is that I should make a separate Debian repository and keep borg archived by Solus separate fromborg
archived by Debian. That is why I made the Solus subdirectory. But does it matter? Are all borg versions compatable? - It is more convenient to run
borg
from within the distro that I happen to be working in. But it would be possible to do allborg
work in one distro and just mount the partitions I want to backup, like I do withtar
. Which is a better strategy? - The attraction of
borg
for me is that it is a quick and easy way to backup workfiles… so I am more likely to do it often. Dont plan to use it for system files. Does anyone know of disadvantages or is there an even better solution to my issues? - I used the simple command line interface. There is a desktop client for
borg
calledvorta
. Has anyone usedvorta
? - I did all that as root. Is that necessary?
References:
- man borg… the manpage is quite readable
- https://linuxconfig.org/introduction-to-borg-backup