A minimal system tray wrapper for Restic to monitor and browse backups
Go to file
Wouter Groeneveld 541b8f0381 update readme for Linux installations 2023-03-15 10:07:26 +01:00
build use fyne package to create a macOS.app folder, add icons, actions, block double-backing, add wait goroutine 2023-03-05 17:02:41 +01:00
cmdtest add readme/todo/license, resilience as timeout when e.g. sftp connection fails 2023-03-06 21:09:27 +01:00
img update readme for Linux installations 2023-03-15 10:07:26 +01:00
restic make Restictray icon explicitly white for non-macOS 2023-03-15 08:37:09 +01:00
.gitignore update readme for Linux installations 2023-03-15 10:07:26 +01:00
LICENSE add readme/todo/license, resilience as timeout when e.g. sftp connection fails 2023-03-06 21:09:27 +01:00
README.md update readme for Linux installations 2023-03-15 10:07:26 +01:00
TODO.md update readme for Linux installations 2023-03-15 10:07:26 +01:00
build.sh use fyne package to create a macOS.app folder, add icons, actions, block double-backing, add wait goroutine 2023-03-05 17:02:41 +01:00
go.mod use a wrapper for cmd "open" to allow for Linux/Win ports 2023-03-14 20:12:37 +01:00
go.sum use a wrapper for cmd "open" to allow for Linux/Win ports 2023-03-14 20:12:37 +01:00
icon-big.png use fyne package to create a macOS.app folder, add icons, actions, block double-backing, add wait goroutine 2023-03-05 17:02:41 +01:00
icon.png make Restictray icon explicitly white for non-macOS 2023-03-15 08:37:09 +01:00
main.go Linux compatibility implementation 2023-03-14 21:19:50 +01:00

README.md

Restictray

A macOS and Linux system tray wrapper around Restic, the Go-powered cmd-line backup tool.

With Restictray, you can monitor and trigger backups from the system tray:

Also tested & working on Linux:

Restictray is designed in such a way that it checks whether or not a backup is needed every hour by looking at the latest date in the restic snapshot output that's also part of the menu. If the backup command fails, the SFTP network goes down, or your laptop is offline, it will resume next time it's booted.

It's also possible to trigger a backup manually.

For convenience, browsing backups in Finder is done through restic mount, which means you will need to install MacFUSE 4.x through https://osxfuse.github.io/ for it to work!

This was designed for my wife to access backups with a button press.

Configuration

Restictray currently expects the following files in ~/.restic/:

  1. password.txt as hardcoded --password-file argument. If not present, creates the file with password "password".
  2. excludes.txt as hardcoded --exclude-file argument. If not present, creates an empty excludes file.
  3. config.json that configures the repository, the folder(s)/file(s) to backup. If not present, creates these defaults:
{
  "repository": "/tmp",
  "backup": "/Users/username",
  "backupTimeInHours": 24
}

If config.json exists but the key backupTimeInHours is absent, it will default to 24: backup once a day.

Where repository is the restic -r argument and backup the folder(s)/file(s) fed into the backup command. That is, you can use SFTP or S3 or ... as you'd normally do, using for instance sftp:user@server:/somewhere/resticdir as a repository value.

The repository should already be initialized! You'll have to do this yourself using restic -r [repo] init.

For more information on how the restic arguments themselves work, please see the restic docs at https://restic.readthedocs.io/en/stable/.

Dev config

If environment variable RESTICTRAY_DEV is set, Restictray configures Zerolog to use stdout and the prettyprint formatter instead of the external log.

Deploying

macOS

Restictray can be wrapped as a macOS .app folder that can be distributed. See build.sh on how to do this---I've used fyne package: see docs at https://developer.fyne.io/started/packaging.

The app also wraps the restic binary so no local install is needed.

Please note that the current supplied one in build/ is an ARM64 macOS-specific binary for that very reason.

Linux

Just go build and copy the binary to install. On Linux you will need to install Restic yourself using your favorite package manager or via the Restic installation page.

Troubleshooting

Restictray uses Lumberjack and Zerolog to log info to ~/.restic/log.txt. If a command fails, it should be logged there.