Skip to main content

Automated rsync backup with password auth & alert system

Workflow preview

Workflow preview
100%
Automated rsync backup with password auth & alert system preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automated Rsync Backup with Password Auth & Alert System Overview This n8n workflow provides automated rsync backup capabilities between servers using password authentication. It automatically inst...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.executecommand, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Vigh Sandor.

Original n8n.io source

1.1 Workflow description

Title
Automated rsync backup with password auth & alert system
Workflow name
Automated rsync backup with password auth & alert system

Automated Rsync Backup with Password Auth & Alert System

Overview

This n8n workflow provides automated rsync backup capabilities between servers using password authentication. It automatically installs required dependencies, performs the backup operation from a source server to a target server, and sends status notifications via Telegram and SMS.

Features

  • Password-based SSH authentication (no key management required)
  • Automatic dependency installation (sshpass, rsync)
  • Cross-platform support (Ubuntu/Debian, RHEL/CentOS, Alpine)
  • Source-to-target backup execution
  • Multi-channel notifications (Telegram and SMS)
  • Detailed success/failure reporting
  • Manual trigger for on-demand backups

Setup Instructions

Prerequisites

  1. n8n Instance: Running n8n with Linux environment
  2. Server Access: SSH access to both source and target servers
  3. Telegram Bot: Created via @BotFather (optional)
  4. Textbelt API Key: For SMS notifications (optional)
  5. Network: Connectivity between n8n, source, and target servers

Server Requirements

Source Server:

  • SSH access enabled
  • User with sudo privileges (for package installation)
  • Read access to source folder

Target Server:

  • SSH access enabled
  • Write access to target folder
  • Sufficient storage space

Configuration Steps

1. Server Parameters Configuration

Open the Server Parameters node and configure:

Source Server Settings:

  • source_host: IP address or hostname of source server
  • source_port: SSH port (typically 22)
  • source_user: Username for source server
  • source_password: Password for source user
  • source_folder: Full path to folder to backup (e.g., /home/user/data)

Target Server Settings:

  • target_host: IP address or hostname of target server
  • target_port: SSH port (typically 22)
  • target_user: Username for target server
  • target_password: Password for target user
  • target_folder: Full path to destination folder (e.g., /backup/data)

Rsync Options:

  • rsync_options: Default is -avz --delete
    • -a: Archive mode (preserves permissions, timestamps, etc.)
    • -v: Verbose output
    • -z: Compression during transfer
    • --delete: Remove files from target that don't exist in source
2. Notification Setup (Optional)

Telegram Configuration:

  1. Create bot via @BotFather on Telegram
  2. Get bot token (format: 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz)
  3. Create notification channel
  4. Add bot as administrator
  5. Get channel ID:
    • Send test message to channel
    • Visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
    • Find "chat":{"id":-100XXXXXXXXXX}

SMS Configuration:

  1. Register at https://textbelt.com
  2. Purchase credits
  3. Obtain API key

Update Notification Node: Edit Process Finish Report --- Telegram & SMS node:

  • Replace YOUR-TELEGRAM-BOT-TOKEN with bot token
  • Replace YOUR-TELEGRAM-CHANNEL-ID with channel ID
  • Replace +36301234567 with target phone number(s)
  • Replace YOUR-TEXTBELT-API-KEY with Textbelt key
3. Security Considerations

Password Storage:

  • Consider using n8n credentials for sensitive passwords
  • Avoid hardcoding passwords in workflow
  • Use environment variables where possible

SSH Security:

  • Workflow uses StrictHostKeyChecking=no for automation
  • Consider adding known hosts manually for production
  • Review firewall rules between servers

Testing

  1. Start with small test folder
  2. Verify network connectivity: ping source_host and ping target_host
  3. Test SSH access manually first
  4. Run workflow with test data
  5. Verify backup completion on target server

How to Use

Automatic Operation

Once activated, the workflow runs automatically:

  • Frequency: Every days midnight

Manual Execution

  1. Open the workflow in n8n
  2. Click on Manual Trigger node
  3. Click "Execute Workflow"
  4. Monitor execution progress

Scheduled Execution

To automate backups:

  1. Replace Manual Trigger with Schedule Trigger node
  2. Configure schedule (e.g., daily at 2 AM)
  3. Save and activate workflow

Workflow Process

Step 1: Dependency Check

The workflow automatically:

  1. Checks if sshpass is installed locally
  2. Installs if missing (supports apt, yum, dnf, apk)
  3. Checks sshpass on source server
  4. Installs on source if needed (with sudo)
Step 2: Backup Execution
  • Connects to source server via SSH
  • Executes rsync command from source to target
  • Uses password authentication for both connections
  • Transfers data directly between servers (not through n8n)
Step 3: Status Reporting

Success Message Format:

[Timestamp] -- SUCCESS :: source_host:/path -> target_host:/path :: [rsync output]

Failure Message Format:

[Timestamp] -- ERROR :: source_host -> target_host :: [exit code] -- [error message]

Rsync Options Guide

Common Options:

  • -a: Archive mode (recommended)
  • -v: Verbose output for monitoring
  • -z: Compression (useful for slow networks)
  • --delete: Mirror source (removes extra files from target)
  • --exclude: Skip specific files/folders
  • --dry-run: Test without actual transfer
  • --progress: Show transfer progress
  • --bwlimit: Limit bandwidth usage

Example Configurations:

# Basic backup
-avz

# Mirror with deletion
-avz --delete

# Exclude temporary files
-avz --exclude='*.tmp' --exclude='*.cache'

# Bandwidth limited (1MB/s)
-avz --bwlimit=1000

# Dry run test
-avzn --delete

Monitoring

Execution Logs
  • Check n8n Executions tab
  • Review stdout for rsync details
  • Check stderr for error messages
Verification

After backup:

  1. SSH to target server
  2. Check folder size: du -sh /target/folder
  3. Verify file count: find /target/folder -type f | wc -l
  4. Compare with source: ls -la /target/folder

Troubleshooting

Connection Issues

"Connection refused" error:

  • Verify SSH port is correct
  • Check firewall rules
  • Ensure SSH service is running

"Permission denied" error:

  • Verify username/password
  • Check user has required permissions
  • Ensure sudo works (for installation)
Installation Failures

"Unsupported package manager":

  • Workflow supports: apt, yum, dnf, apk
  • Manual installation may be required for others

"sudo: password required":

  • User needs passwordless sudo or
  • Modify installation commands
Rsync Errors

"rsync error: some files/attrs were not transferred":

  • Usually permission issues
  • Check file ownership
  • Review excluded files

"No space left on device":

  • Check target server storage
  • Clean up old backups
  • Consider compression options
Notification Issues

No Telegram message:

  • Verify bot token and channel ID
  • Check bot is admin in channel
  • Test with curl command manually

SMS not received:

  • Check Textbelt credit balance
  • Verify phone number format
  • Review API key validity

Best Practices

Backup Strategy
  1. Test First: Always test with small datasets
  2. Schedule Wisely: Run during low-traffic periods
  3. Monitor Space: Ensure adequate storage on target
  4. Verify Backups: Regularly test restore procedures
  5. Rotate Backups: Implement retention policies
Security
  1. Use Strong Passwords: Complex passwords for all accounts
  2. Limit Permissions: Use dedicated backup users
  3. Network Security: Consider VPN for internet transfers
  4. Audit Access: Log all backup operations
  5. Encrypt Sensitive Data: Consider rsync with encryption
Performance
  1. Compression: Use -z for slow networks
  2. Bandwidth Limits: Prevent network saturation
  3. Incremental Backups: Rsync only transfers changes
  4. Parallel Transfers: Consider multiple workflows for different folders
  5. Off-Peak Hours: Schedule during quiet periods

Advanced Configuration

Multiple Backup Jobs

Create separate workflows for:

  • Different server pairs
  • Various schedules
  • Distinct retention policies
Backup Rotation

Implement versioning:

# Add timestamp to target folder
target_folder="/backup/data_$(date +%Y%m%d)"
Pre/Post Scripts

Add nodes for:

  • Database dumps before backup
  • Service stops/starts
  • Cleanup operations
  • Verification scripts
Error Handling

Enhance workflow with:

  • Retry mechanisms
  • Fallback servers
  • Detailed error logging
  • Escalation procedures

Maintenance

Regular Tasks
  • Daily: Check backup completion
  • Weekly: Verify backup integrity
  • Monthly: Test restore procedure
  • Quarterly: Review and optimize rsync options
  • Annually: Audit security settings
Monitoring Metrics

Track:

  • Backup duration
  • Transfer size
  • Success/failure rate
  • Storage utilization
  • Network bandwidth usage

Recovery Procedures

Restore from Backup

To restore files:

# Reverse the rsync direction
rsync -avz target_server:/backup/folder/ source_server:/restore/location/

Disaster Recovery

  1. Document server configurations
  2. Maintain backup access credentials
  3. Test restore procedures regularly
  4. Keep workflow exports as backup

Support Resources

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Manual Trigger

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Server Parameters

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 3 - Check Sshpass Local

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 4 - Is Installed Local?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 5 - Install Sshpass Local

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 6 - Check Sshpass on Source

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 7 - Is Installed on Source?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 8 - Install Sshpass on Source

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 9 - Execute Rsync Backup

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 10 - Success?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 11 - Backup Successful

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 12 - Backup Failed

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 13 - Process Finish Report --- Telegam & SMS

Type / Role
n8n-nodes-base.executeCommand - executeCommand
Config choices
Version 1

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

3. Summary Table

Workflow Automated rsync backup with password auth & alert system
Complexity advanced
Nodes 21
Categories DevOps
Author Vigh Sandor
Published 18 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9873/9873.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated rsync backup with password auth & alert system do?

Automated Rsync Backup with Password Auth & Alert System Overview This n8n workflow provides automated rsync backup capabilities between servers using password authentication. It automatically inst...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.