Back up Linux server directories to Google Drive with Borg over SSH
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs when someone submits an n8n form (“Borg Backup Settings”) (plus 1 other trigger). Along the way it connects Google Drive.
How it runs
Trigger: When someone submits an n8n form (“Borg Backup Settings”) (plus 1 other trigger).
- Init Backup Config Table (Data table): create (table)
- Get Config (Data table): get
- Build Initial Config (Code): runs custom JavaScript code
- Install Borg on Server (SSH): uses SSH
- Store Borg Passphrase on Server (SSH): uses SSH
- Build Runtime Config (Code): runs custom JavaScript code
- Save Config (Data table): create or update
- Create Server Backup (SSH): uses SSH
- Export Backup Archive (SSH): uses SSH
- Download Backup Archive (SSH): download (file)
…plus 8 more steps. See the full node list below.
Services it uses
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (7)
- Code
n8n-nodes-base.code - SSH
n8n-nodes-base.ssh - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Google Drive
n8n-nodes-base.googleDrive - Data table
n8n-nodes-base.dataTable - If
n8n-nodes-base.if - n8n Form Trigger
n8n-nodes-base.formTrigger
From the author
Quick overview This workflow collects backup settings via an n8n form, creates a Borg backup of a server directory over SSH, packages the Borg repository into a tar.gz archive, and uploads it to a chosen Google Drive folder in either sync (single latest file)…