Maximum PC - USA (2021-Holiday)

(Antfer) #1
path/to/repo:archive_name /path/to/data command to create a
new archive within the repository:
$ borg create ~/Documents/temp/repo::first-archive ~/
Documents/LXF-submissions ~/Pictures/for-LXF/
>> In this command, we have created a new archive called first-
archive. Borg will recursively traverse through the specified
directories and add files to the specified archive. When we create
a follow-up archive, only new content from these directories is
added to the archive:
$ borg create --stats ~/Documents/temp/repo::second-backup ~/
Documents/LXF-submissions ~/Pictures/for-LXF/
Enter passphrase for key /home/linuxlala/Documents/temp/
repo:
Creatingarchive at“/home/linuxlala/Documents/temp/
repo::second-backup”
---------------------------------------------------------------------------
Archive name: fifth-backup
Archive fingerprint: c4ce413d82e4d00b9b4defdf8eadd
c8af6 7 4059a8044aac905e00c527c8224d 8
Time (start): Mon, 2021-09-27 18:33:14
Time (end): Mon, 2021-09-27 18:33:14
Duration: 0.19 seconds
Number of files: 1 0
Utilization of max. archive size: 0%
-------------------------------------------------------------------------
Original Compressed Deduplicated
This archive: 3 5.43 MB 3 3.9 1 MB 2 .39 kB
All archives: 140 .38 MB 134 .28 MB 3 3.80 MB
Unique chunks Total chunks
Chunk index: 38 115
-------------------------------------------------------------------------
>> Take a look at the last column in the Deduplicated size. This
tells you that the archive only has backed up 2 .39K of new data,
as all the other data in the specified directories is already part of
another archive.

4

MOUNT AND EXTRACT ARCHIVES

As its name suggests, you use the borg extract command
to extract data from an archive. By default, Borg will
extract the entire content of the specified archive, but you can
choose the data you wish to extract using the --exclude option,
or even the PATH.

>> Using our previous example where we created
an archive of two directories ~/Documents/LXF-
submissions and ~/Pictures/for-LXF/, we can extract
all the image files using either pattern matching or the
directory path:
$ borg extract ~/Documents/temp/repo::first-backup ~/
Pictures/for-LXF
Enter passphrase for key /home/linuxlala/Documents/
temp/repo:
>> You can similarly use the --exclude command
option to restrict Borg:
$ borg extract ~/Documents/temp/repo::fifth-backup
–exclude ‘*.odt’
Enter passphrase for key /home/linuxlala/Documents/
temp/repo:
>> The borg mount command can be used to mount
an archive. First, create a mount point for the archive:
$ mkdir /tmp/backup
$ borg mount~/Documents/temp/repo::second-backup/
tmp/backup
>> You can now open the /tmp/backup directory in your
favorite file manager and look through the contents. Be
sure to unmount the archive with the borg umount /tmp/
backup command after you’re done.
>> You’ll also appreciate the borgdiff sub-command,
which can be used to compare the contents of two
archives. The borg diff ~/Documents/temp/repo::second-
backupthird-backup command will inform you of all the
changes between archives.
>> There’s much more you can do with this utility.
All the information you need to understand Borg’s
full capabilities is in help pages for each of the sub-
commands, or on the project’s website.

When creating a new archive, you can also use the


  • -compression or the - C command option to create a
    compressed backup archive. Borg defaults to using LZ4,
    which is fast but offers little compression.
    Borg also supports other compression algorithms,
    such as zstandard, zlib, and lzma. You can use a mix of
    compression algorithms for different archives within the
    same repository. This is because deduplication is done on
    the source data chunks.
    With the exception of the default LZ4, all other
    algorithms expect a compression level. For zstd, the
    compression levels range from 1-22, while for zlib and
    lzma, the options are 0 -9. borg create - -compression lzma, 4
    repo/path::archive-name data-sources creates an archive
    using the lzma algorithm.
    You can also direct Borg to decide whether the data
    needs to be compressed or not. This is done with the auto
    command option. Borg attempts to use the lz4 compression
    on each file, and should the file be compressive, uses the
    defined compression algorithm and level:
    $ borg create - -compression auto,lzma, 4 repo/
    path::archive-name data-sources
    Borg will first test each file’s compressibility using
    the lz4 algorithm. If the file can be compressed, Borg will
    compress it using the lzma with level 4.


COMPRESSED

ARCHIVES



When creating an archive, you can timestamp the archive for smarter
filenames. This is more efficient than numbering your backups manually.




HOL 2021 MAXIMUMPC 65
Free download pdf