Restray logo

Restray

Powerful but friendly backup program that runs in your tray

This article is a quick guide to getting your first backup going, and some other info you may want to know.

Keep in mind: this is a wrapper program that, internally, uses the widely known, powerful, efficient, and secure restic command-line tool to back up and manage data

Install

Download the latest version for your operating system and architecture from the Restray home.

If you do not have restic installed on Windows or Linux, you can click Install Restic in the tray menu. MacOS already has it bundled in the .app.

Nix user on Linux/MacOS? There’s a package and modules in the flake :)

Set it up

Everything you need is under Configure in the tray menu. You can use Open Web Editor to edit in your browser, or edit the two files with your system’s text editor.

This guide uses the text editor, but you can follow along in the web editor too.

1. Write your env file

The env file tells Restray where your backups will be stored (restic calls this a “repository”), and what the password is. For an external drive, it could look like this:

RESTIC_REPOSITORY=/Volumes/MyDrive/backups
RESTIC_PASSWORD=something-unique-and-secure

Please do not lose this password! You will not be able to restore your backups without it, so securely keep a copy somewhere like your password manager (restic backups are always encrypted, by design!)

Restic also supports backing up to remote destinations or cloud storage:

Remote destinations and cloud storage examples

Use one of these, along with your RESTIC_PASSWORD:

# SSH (needs key login with no password prompt)
RESTIC_REPOSITORY=sftp:user@host:/path/to/backups

# restic's REST server
RESTIC_REPOSITORY=rest:https://user:pass@host:8000/

# S3 or S3-compatible storage
RESTIC_REPOSITORY=s3:https://your-s3-endpoint/bucket-name
AWS_ACCESS_KEY_ID=your-key-id
AWS_SECRET_ACCESS_KEY=your-secret-key

# OneDrive, Google Drive, etc. (set up with rclone first)
RESTIC_REPOSITORY=rclone:remote-name:backups

See restic’s list of repository types for more options and details on each, and rclone’s site.

You can use something like Tailscale or NetBird to effortlessly connect remotely across networks.

A common misconception

(Atleast I was a bit confused about this when I first started using restic.)

You can assign multiple devices to the same restic repository, and restic will automatically record each snapshot separately by their hostname. You do not need to make a separate repository per device.

The main benefit of doing this is: restic will deduplicate files across devices, often saving lots of space in some scenarios.

However, as each device has permission to read/delete eachother’s backup data, it is generally recommended that you make a separate repository per user or trust boundary, rather than per device.

2. Write your config file

The config file tells Restray what to back up, and when to back up. Find the cron and paths lines, and fill in both with whatever you’d like (this is just an example):

[profiles.schedule]
  cron = "0 * * * *" # every hour, see https://crontab.guru for help
[profiles.backup]
  paths = ["/Users/you/Documents", "/Users/you/Pictures"]

On MacOS, you may also need to give Full Disk Access permissions to Restray if you’re backing up protected folders. Otherwise MacOS will prompt you, which can cause a backup to pause if you’re away from the computer.

3. Your first backup

  1. Click Initialize Repository if it shows up (you only need to do this for a new repository)
  2. Click Run Schedule Now to manually run your configured schedule

That’s it… as long as Restray is running, it’ll back up your configured files on your schedule 🎉

Getting files back

Restray does not currently have a built-in GUI for restoring files, as its main focus is being a convenience tool for scheduling backups. I may consider working on a native backup explorer though.

As a solution, third-party programs exist for this specific task; For example, I’d suggest trying restic-browser, which is a GUI available on all major operating systems.

Using mount (MacOS and Linux)

If you’d rather browse and restore your files from your file explorer, on MacOS and Linux you can use restic’s mount feature through Operations > Mount. However, on MacOS, this requires that you install either FUSE-T or macFUSE. And on Linux, this requires that you install FUSE. Windows does not currently support this.

Using the command line

If you’re familiar with the command line, you can always just use restic itself to restore from a snapshot. Clicking Operations > Shell will open a terminal with your repository, password, and restic already loaded, so you can run any restic command right away, without setting anything up:

restic snapshots                         # list your backups
restic restore latest --target restored  # copy the latest one into a "restored" folder

Restored files keep their folder structure, so they might be a few folders deep inside restored. There’s much more info about the CLI in restic’s restore docs.

Freeing up space

Backups pile up over time, so pruning lets you delete old snapshots to free up space. To have it run during your schedule, set prune in your existing [profiles.schedule] section:

[profiles.schedule]
  prune = true

By default, it’s configured to keep your last 4 snapshots, plus 24 hourly, 7 daily, 4 weekly, and 12 monthly ones. The rest are deleted for good! You can change this with args under [profiles.prune] (see restic’s docs on removing snapshots).

You can also run it manually with Operations > Prune.

Checking repository integrity

Checking makes sure your repository isn’t damaged. To have it run on your schedule, set the same with check. Keep in mind this can make scheduled runs take a lot longer for large repositories:

[profiles.schedule]
  check = true

You can also run it manually with Operations > Check.

A normal check doesn’t read through all of your backed up data. If you want to test some of that too, set args = ["--read-data-subset=5%"] under [profiles.check] to read a random 5% each time. restic’s docs explain more.

Other features

Restray supports many other features which you might want to take a look at later:

Every config option is listed in the README. Restray is still beta software, so if you run into a bug, please make an issue. And try restoring a file every once in a while to ensure your backups work :)

Sources