Running Restic & Rclone Commands
Pluton is built on restic and rclone. It ships its own copies of both binaries and keeps rclone's remote configuration in a private config file. Sometimes you need to talk to a repository directly, for example to inspect snapshots, restore a single file, or repair a damaged index.
To make this easy, both the Pluton server and the Pluton agent create two wrapper commands during installation: prestic and prclone. They let you run any restic or rclone command using Pluton's bundled binaries and configuration, so you never have to remember binary paths, the rclone config location, or the -o rclone.program glue.
Why the wrappers exist
Without the wrappers, running a restic command against a Pluton repository is verbose. You would have to:
- Call the specific restic binary that Pluton shipped (not any
resticon yourPATH). - Tell restic which rclone binary to use for remote storage, with
-o rclone.program=/path/to/rclone. - Point rclone at Pluton's config file with
--config /path/to/rclone.confso it can find your remotes.
The wrappers bake all of that in. prestic and prclone are thin scripts that call the bundled binaries with the right flags already filled in, then pass through whatever arguments you add.
# prclone runs the bundled rclone with Pluton's config
exec /path/to/rclone --config /path/to/rclone.conf "$@"
# prestic runs the bundled restic wired to the bundled rclone and its config
export RCLONE_CONFIG=/path/to/rclone.conf
exec /path/to/restic -o rclone.program=/path/to/rclone "$@"
Because every argument is passed straight through, any restic or rclone subcommand works. Just replace restic with prestic and rclone with prclone.
Where the wrappers live
The wrappers are installed system-wide (or added to PATH) so you can run them from any shell.
| Deployment | Commands | Location |
|---|---|---|
| Server (Linux) | prestic, prclone | /usr/local/bin |
| Server (Docker) | prestic, prclone | /usr/local/bin (inside the container) |
| Agent (Linux/macOS) | prestic, prclone | /usr/local/bin |
| Agent (Windows) | prestic.bat, prclone.bat | agent bin folder, added to system PATH |
In a Docker server deployment the wrappers exist inside the container, not on the host. Run them with docker exec, for example:
docker exec -it pluton prestic -r <repo> snapshots
Addressing a repository and password
Two things every restic command needs: which repository to act on, and the repository password.
Repository (-r). Pluton stores repositories through rclone remotes, addressed as rclone:<remote>:<path>, where <remote> is the storage name configured in Pluton and <path> is the repository path within that storage. Local storage repositories are just a filesystem path.
# Remote (S3, B2, Backblaze, etc.) storage named "my-s3", repo under backups/laptop
prestic -r rclone:my-s3:backups/laptop snapshots
# Local storage repository
prestic -r /var/lib/pluton/backups/laptop snapshots
Password. The repository password is your Pluton Encryption Key. restic will prompt for it, or you can supply it through the RESTIC_PASSWORD environment variable.
To avoid repeating -r and the password on every command, export them once for your shell session:
export RESTIC_REPOSITORY='rclone:my-s3:backups/laptop'
export RESTIC_PASSWORD='<your-pluton-encryption-key>'
prestic snapshots
prestic stats
Common restic commands
Read-only commands are safe to run at any time. Use -r <repo> (or RESTIC_REPOSITORY) with each.
# List all snapshots in the repository
prestic -r <repo> snapshots
# Show repository size and statistics
prestic -r <repo> stats
# List the files contained in a snapshot
prestic -r <repo> ls <snapshotID>
# Search for a file across snapshots
prestic -r <repo> find <filename>
# Verify repository integrity
prestic -r <repo> check
# Restore a snapshot (or a single path) to a target directory
prestic -r <repo> restore <snapshotID> --target /tmp/restore
prestic -r <repo> restore <snapshotID> --target /tmp/restore --include /etc/hosts
# Remove a stale lock left by an interrupted run
prestic -r <repo> unlock
# Repair a damaged index or damaged pack files
prestic -r <repo> repair index
prestic -r <repo> repair packs
Commands such as forget, prune, repair, and unlock modify the repository. Avoid running them while a Pluton backup, prune, or integrity check is active for the same repository, and prefer restoring to a new target directory so you do not overwrite live data.
Common rclone commands
prclone uses Pluton's rclone configuration, so all of your configured storages are available as remotes.
# List the remotes Pluton has configured
prclone listremotes
# Show storage usage / quota for a remote
prclone about my-s3:
# List directories and files under a remote path
prclone lsd my-s3:backups
prclone ls my-s3:backups/laptop
# Show the total size of a remote path
prclone size my-s3:backups/laptop
# Copy files out of a remote to a local folder
prclone copy my-s3:backups/laptop /tmp/pulled --progress
prclone and prestic accept every flag the underlying tools do. When in doubt, run prestic help or prclone help (or prestic <command> --help) to see the full option list for the bundled version.