Chapter 3

Using resticprofile

Here are a few examples how to run resticprofile (using the main example configuration file)

See all snapshots of your default profile:


See all available profiles in your configuration file (and the restic commands where some flags are defined):

resticprofile profiles

Profiles available (name, sections, description):
  root:           (backup, copy, forget, retention)
  self:           (backup, check, copy, forget, retention)
  src:            (backup, copy, retention, snapshots)

Groups available (name, profiles, description):
  full-backup:  [root, src]

Backup root & src profiles (using full-backup group shown earlier)

resticprofile --name "full-backup" backup

or using the syntax introduced in v0.17.0:

resticprofile full-backup.backup

Assuming the stdin profile from the configuration file shown before, the command to send a mysqldump to the backup is as simple as:

mysqldump --all-databases --order-by-primary | resticprofile --name stdin backup

or using the syntax introduced in v0.17.0:

mysqldump --all-databases --order-by-primary | resticprofile stdin.backup

Mount the default profile (default) in /mnt/restic:

resticprofile mount /mnt/restic

Display quick help

resticprofile --help

A command is either a restic command or a resticprofile own command.

Command line reference

There are not many options on the command line, most of the options are in the configuration file.

  • [-h | –help]: Display quick help
  • [-c | –config] configuration_file: Specify a configuration file other than the default (“profiles”)
  • [-f | –format] configuration_format: Specify the configuration file format: toml, yaml, json or hcl
  • [-n | –name] profile_name: Profile section to use from the configuration file. You can also use [profile_name].[command] syntax instead, this will only work if -n is not set. Using -n [profile_name] [command] or [profile_name].[command] both select profile and command and are technically equivalent.
  • [–dry-run]: Doesn’t run the restic commands but display the command lines instead
  • [-q | –quiet]: Force resticprofile and restic to be quiet (override any configuration from the profile)
  • [-v | –verbose]: Force resticprofile and restic to be verbose (override any configuration from the profile)
  • [–trace]: Display even more debugging information
  • [–no-ansi]: Disable console colouring (to save output into a log file)
  • [–no-lock]: Disable resticprofile locks, neither create nor fail on a lock. restic locks are unaffected by this option.
  • [–theme]: Can be light, dark or none. The colours will adjust to a light or dark terminal (none to disable colouring)
  • [–lock-wait] duration: Retry to acquire resticprofile and restic locks for up to the specified amount of time before failing on a lock failure.
  • [-l | –log] file path or url: To write the logs to a file or a syslog server instead of displaying on the console. The format of the server url is tcp:// or udp://localhost:514. For custom log forwarding, the prefix temp: can be used (e.g. temp:/t/msg.log) to create unique log output that can be fed into a command or http hook by referencing it with {{ tempDir }}/... or {{ tempFile "msg.log" }} in the configuration file.
  • [-w | –wait]: Wait at the very end of the execution for the user to press enter. This is only useful in Windows when resticprofile is started from explorer and the console window closes automatically at the end.
  • [resticprofile OR restic command]: Like snapshots, backup, check, prune, forget, mount, etc.
  • [additional flags]: Any additional flags to pass to the restic command line