Mounting Restic Backups to a Linux Server

With Linux (unfortunately, this feature is not available for Windows) you can mount your restic repo to a location of your choice, to navigate ALL of your snapshots in a directory tree.

As with any interaction with Restic, you must first initialize the repo to perform actions within restic, to do so follow this guide.

You may need to install fuse if it is not installed already, to do so run the following comands  –

CentOS

yum install fuse

Ubuntu

apt-get install fuse

Fedora

yum install fuse

Debian

apt-get install fuse

To mount your restic repo, simply create a mount point of your choosing, in this example we will use /mnt/backups

After running this, the process will remain running until you cancel it (ctrl + c) so you’ll need to open another terminal, or FTP client to browse your backups.

Using the above example’s mount point, your backups (snapshots) are located in /mnt/backups/snapshots

Each snapshot is labeled with a date and timestamp, and your latest backup is in a symlink folder labeled latest.

These files are read-only, meaning that you cannot move or edit them, however you can copy them.

Navigate the folders as you would within your own filesystem, and locate the files you wish to restore, you can use the copy command in Linux to copy the file(s) or folder(s) you are wishing to restore, you can then specify the location you are wishing to restore them to, or if you wish you can do so to their original location. The choice is completely up to you.

The command syntax to copy a file or folder would be as follows –

cp filename filepath/filename

ie:

cp testfile.txt /root/txtfile.txt

You can copy more than one file or folder, through the following command

cp -R myDirectory/ /root/mydirectory

Once you’re finished, you can cancel the mount command you ran in the original terminal window.


Share:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.