Back up Linux servers to a remote server using Borg and SSH
Ready for 3.0What this workflow does
This workflow has 15 nodes and runs when someone submits an n8n form (“Borg Backup to Remote Server”) (plus 1 other trigger). It uses only n8n's built-in nodes.
How it runs
Trigger: When someone submits an n8n form (“Borg Backup to Remote Server”) (plus 1 other trigger).
- Build Backup Config Code (Code): runs custom JavaScript code
- Load Backup Configuration (Data table): get
- Store Borg Passphrase on Source Server (SSH): uses SSH
- Install Borg on Source Server (SSH): uses SSH
- Initialize Configuration Table (Data table): create (table)
- Install Borg on Destination Server (SSH): uses SSH
- Save Backup Configuration (Data table): create or update
- Source: Check & Get SSH Key (SSH): uses SSH
- Parse SSH Setup Result (Code): runs custom JavaScript code
- Destination: Create Restricted borg_backup User (SSH): uses SSH
…plus 3 more steps. See the full node list below.
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- SSH
n8n-nodes-base.ssh - Data table
n8n-nodes-base.dataTable - Schedule Trigger
n8n-nodes-base.scheduleTrigger - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - n8n Form Trigger
n8n-nodes-base.formTrigger
From the author
Quick overview This workflow collects Borg Backup settings via an n8n form, stores them in an n8n Data Table, and then runs scheduled SSH commands to install Borg, set up restricted SSH access, and back up a chosen directory from a source Linux server to a…