Restic Backup
AI-generatedSummary
Runs restic backup --json on the n8n host for one or more local paths, using a Restic Repository credential, and returns the backup summary and progress messages for each input item.
Inputs
- Paths (required) — Local paths to back up, one per line. Blank lines are ignored. At least one path is required.
- Tags — Comma- or newline-separated tags. Each tag is passed as a separate
--tag. - Exclude Patterns — Exclude patterns, one per line. Each is passed as a separate
--exclude. - Hostname — Overrides the host recorded in the snapshot, passed as
--host. - Restic Binary — Restic binary name or absolute path. Defaults to
resticand must not be empty. - Command Timeout — Maximum run time in seconds (1–86400, default 3600). On timeout the process receives SIGTERM, and the run normally fails with a non-zero exit code.
- Additional Arguments — Extra arguments for
restic backup, parsed shell-style with quotes and backslash escapes. They are inserted before the paths. An unterminated quote raises an error.
Output shape
One output item per input item, with a resticBackup object in the JSON. It contains status ('completed'), repository, paths, tags, excludes, hostname, command, arguments, sftpCommand, summary (restic's summary message, including snapshot ID and file/byte counts), latestStatus, messages, timedOut, and optionally omittedMessageCount, unparsedOutput and stderr.
The operation needs a Restic Repository credential with a repository and either a password or a password file. The credential may also set environment variables and an SFTP command (passed as
-o sftp.command=...). Theargumentsfield is the full argument list and could expose the SFTP command. Themessagesarray holds at most 250 entries, and any beyond that are counted inomittedMessageCount. A non-zero exit code throws an error that includes stderr, unparsed stdout and the latest status. With Continue On Fail enabled, the node instead outputs{error}for that item. The restic binary must be installed and accessible on the n8n host.
Examples
Example 1: Nightly backup of the n8n data directory with tags
Paths: /home/node/.n8n; Tags: n8n, daily; Exclude Patterns: *.tmp; Restic Repository credential configured; trigger with a Schedule node.
Example 2: Backup with extra restic options and a longer timeout
Paths: /data; Additional Arguments: --one-file-system --compression max; Command Timeout: 7200; Hostname: nas-01.