Skip to content

💾 Remote Backup: Create & upload backups to a remote server over SSH 💾

License

Notifications You must be signed in to change notification settings

lytexdev/remote-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Remote Backup

Overview

A Rust-based command-line application for creating, encrypting, and uploading backups to a remote server over SSH. This tool supports compression, encryption, and configurable backup retention policies.

Installation

Prerequisites

  • Rust
  • Cargo

Clone the repository

git clone https://github.com/lytexdev/remote-backup.git
cd remote-backup

Edit the config.toml configuration file

  1. Copy and rename config.example.toml to config.toml
  2. Edit the config.toml file with the appropriate paths, encryption key path, and server information

Build the application

cargo build --release

The binary will be available in ./target/release/remote-backup.

Configuration

Configure config.toml as follows:

[backup]
backup_folder = "/path/to/folder"           # Folder to backup
exclude_paths = ["/path/to/folder/cache"]   # Paths to exclude from backup
exclude_hidden = false                      # Exclude hidden files and directories (files/directories starting with .)
remote_backup_dir = "/path/to/remote/dir"   # Directory on the remote server
restore_path = "/path/to/restore"           # Directory to restore files locally
compression_level = 9                       # Compression level (1-9)
max_backups = 3                             # Maximum number of backups to retain
tmp_path = "/path/to/tmp"                   # Temporary file path for local backup

[ssh]
host = "127.0.0.1"                          # Remote server hostname or IP
port = 22                                   # SSH port
user = "your-username"                      # SSH user
identity_file = "/path/to/ssh/key"          # Path to SSH private key file

[encryption]
key_path = "/path/to/encryption/key"        # Path were the encryption key will be generated and stored

Key Generation

Before running backups, generate a 32-byte encryption key file in the configured key_path:

./target/release/remote-backup generate-key

This will create a binary encryption key file at the specified key_path, used to securely encrypt and decrypt backups

Usage

Running a Backup

To create, encrypt, and upload a backup to the remote server:

./target/release/remote-backup backup

Listing Backups

To list all backups stored on the remote server:

./target/release/remote-backup list

Restoring a Backup

To download and decrypt a specific backup:

./target/release/remote-backup restore <backup-file-name>

Features

  • Compression: Backups are compressed using XZ for storage efficiency
  • Encryption: Ensures secure backup storage with encryption key specified in config.toml
  • Configurable Paths: Custom paths for backup, restoration, and temporary files
  • Retention Policy: Automatically deletes the oldest backup when the limit is reached

License

This project is licensed under the GNU General Public License v2. See the LICENSE file for details.

About

💾 Remote Backup: Create & upload backups to a remote server over SSH 💾

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages