LoAr Light Icon LoAr Dark Icon

LoAr

Local Archive & Sync Utility

Safely and efficiently back up multiple development projects scattered across your system into a single backup destination. It selectively targets files excluded by Git (like .gitignore entries, passwords, keys, certificates, and documents) to encrypt and sync them to your custom backup drive. Written in Rust for maximum speed and security.

Automatically detects your OS/Architecture, downloads the matching release, and registers the executable path.

macOS / Linux (Shell)
curl -fsSL https://raw.githubusercontent.com/cavecafe-cc/homebrew-tap/main/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/cavecafe-cc/homebrew-tap/main/install.ps1 | iex

Install and manage updates easily on macOS using Homebrew tap.

Homebrew
brew tap cavecafe-cc/homebrew-tap
brew install loar

Install via Scoop on Windows. If Scoop is not installed, install it first using PowerShell:

Install Scoop (PowerShell)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
scoop --version

Then, install LoAr using Scoop:

Install LoAr
scoop install https://raw.githubusercontent.com/cavecafe-cc/LocalArchive/main/scoop/loar.json

Key Features

High-Speed Incremental Skip

Compares file size, modification time (mtime), and SHA-256 hash automatically to skip backup copying and encryption for unchanged files. Saves extreme I/O, completing syncs in seconds.

One-Way Sync & Auto Cleanup

Automatically deletes backed-up files from the target drive if they are deleted in the source directory. Cleans up empty folders and leftover metadata (like macOS `.DS_Store`) using a bottom-up Depth-First Search (DFS) algorithm.

AES-256-GCM Encryption

Configure encryption independently per repository. Uses Argon2id for secure key derivation and AES-256-GCM to obfuscate filenames and encrypt all file contents safely.

SQLite Metadata DB

Manages archiving histories and file indexes in an SQLite database file (`loar.db`) located at the target directory root. Automatically runs `VACUUM` to prune and optimize DB file size.

Dual TUI & CLI Modes

Provides an interactive Terminal User Interface (TUI) menu console for easy backup and restore management, alongside a fully non-interactive CLI mode suitable for automated cron jobs.

Configuration Guide

LoAr uses a simple configuration file located at ~/.loar/loar.toml to manage target paths, exclusions, and individual repository settings.

~/.loar/loar.toml
# Destination folder where all backups are stored
target_dir = "/Volumes/Backup/LoAr"

# Global exclude patterns applied to all repositories (Gitignore syntax)
global_exclude = [
    ".DS_Store",
    "node_modules/",
    "target/",
    "bin/",
    "obj/",
    ".vscode/",
    "ephemeral/"
]

# List of repositories to sync
[[repositories]]
name = "MyProject"                            # Folder name identifier in target_dir
path = "/Users/username/Projects/MyProject"  # Source folder path
encrypt = false                              # Enable or disable encryption
one_way_sync = true                          # Automatically sync deletions

Usage Commands

Run commands in non-interactive CLI mode for automation, or simply type loar to launch the interactive Terminal UI.

loar Interactive

Launches the interactive TUI menu to list repositories, run backup, register new ones, or restore files.

loar run --all CLI

Runs incremental backups for all registered repositories sequentially. Perfect for background scheduling.

loar run --repo <name> CLI

Backs up a specific repository. For encrypted repositories, pass --password "pwd" to bypass prompt.

loar status CLI

Displays registered repositories, current encryption/sync status, and last backup timestamps.

loar register --name "WWW" --path "/path" CLI

Registers a new repository via CLI. Add --encrypt to enable encryption, or --no-sync to disable one-way sync.

loar restore --repo <name> --dest <dest> CLI

Restores backed-up files from a specific repository archive to a designated local path.

loar unregister --repo <name> CLI

Safely removes a repository from database indexing and deletes its database history and backed-up files.