Skip to content

About

lightweight and efficient backup and sync tool

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BackupSync πŸ›‘οΈπŸ“‚

A fast, efficient, and cross-platform backup & synchronization tool written in Rust!


✨ Features

βœ… Backup & Sync β€” Supports incremental backup, only copying files if they are newer.

βœ… Multi-threading β€” Uses multiple threads for faster file copying.

βœ… Compression Support β€” Backup as .tar.gz (default) or .zip (optional).

βœ… Progress Bar β€” See live progress with indicatif.

βœ… Logging β€” Saves backup history in backup_log.txt.

βœ… Config File Support β€” Define paths in config.toml for automation.

βœ… Cross-Platform β€” Works on Windows, Linux, macOS.

βœ… CLI Friendly β€” Run via terminal:


backupsync ~/Documents ~/Backup 

βœ… Automation Support β€” Schedule backups with crontab (Linux/macOS) or Task Scheduler (Windows).


πŸ’‘ Why Use BackupSync?

Unlike high-level backup software, BackupSync is:

βœ… Lightweight β€” No unnecessary UI, just raw speed.

βœ… Optimized for Performance β€” Uses multi-threading and recursive traversal for fast backups.

βœ… Cross-Platform β€” Works on Windows, Linux, macOS without dependencies.

βœ… Open Source β€” Modify, extend, and contribute!


πŸš€ Installation

πŸ“Œ Method 1: Download Prebuilt Binary (Recommended for Linux/macOS)

  1. Download the latest backupsync binary from Releases. Move it to a system-wide location:
sudo mv backupsync /usr/local/bin/
  1. Now, you can run backupsync from anywhere!

πŸ“Œ Method 2: Build from Source (Requires Rust)

  1. Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  1. Clone the repository:
git clone https://github.com/YOUR_GITHUB/backupsync.git  
cd backupsync  
cargo build --release

  1. Move the compiled binary to /usr/local/bin/ (Linux/macOS).

πŸ“Œ Method 3: For Windows

  1. Install Rust (if not installed):
  • Download and install Rust for Windows.
  • Restart your terminal after installation.

  1. Clone the repository: Open PowerShell and run:
git clone https://github.com/lakshyajn/BackupSync.git
cd BackupSync
  1. Build the project:
cargo build --release
  1. Move the binary to system PATH (Optional, for global usage):
$env:Path += ";$PWD\target\release"

πŸ› οΈ Usage

πŸ”Ή Basic Backup (CLI)

Run the following command (For Linux,macOS):

backupsync <source_folder> <backup_folder>

πŸ“Œ Example:

backupsync ~/Documents ~/Backup
This will incrementally copy all files from ~/Documents to ~/Backup.

Run the following command (For Windows):

  • Once installed, you can run it from the terminal.
backupsync C:\Users\YourUsername\Documents C:\Users\YourUsername\Backup

  • If you didn't moved it to your parent working directory (For all OSs):
cd backupsync
./target/release/backupsync C:\Users\YourUsername\Documents C:\Users\YourUsername\Backup

πŸ”Ή Enable Compression

  • To create a .tar.gz backup instead of raw files:
backupsync ~/Documents ~/Backup tar.gz
  • To create a .zip backup:
backupsync  ~/Documents ~/Backup zip

πŸ”Ή Using a Config File (config.toml)

  • Instead of typing paths every time, create a config.toml file:
source = "/home/user/Documents"
backup = "/home/user/Backup"
  • Then, just run:
backupsync
  • It will read paths from config.toml automatically.

πŸ“œ Backup Log (backup_log.txt)

All backup operations are logged in backup_log.txt, including copied files and errors.

[2025-02-06 12:34:56] Copied /home/user/Documents/file1.txt -> /home/user/Backup/file1.txt
[2025-02-06 12:34:58] Copied /home/user/Documents/file2.jpg -> /home/user/Backup/file2.jpg

πŸ€– Automating Backups

πŸ”Ή Linux/macOS (crontab)

  • Open crontab:
crontab -e
  • Add this line to schedule a daily backup at 2 AM:
0 2 * * * /usr/local/bin/backupsync ~/Documents ~/Backup

πŸ”Ή Windows (Task Scheduler)

  1. Open Task Scheduler (Win + R, type taskschd.msc, press Enter).
  2. Click Create Basic Task β†’ Name it "BackupSync".
  3. Set Trigger β†’ Choose Daily or your preferred schedule.
  4. Set Action β†’ Select Start a program.
  5. Browse for the backupsync.exe file in your target/release/ folder.
  6. Add arguments:
"C:\Users\YourName\Documents" "D:\Backup"

πŸ“¦ Using BackupSync as a Rust Crate

If you want to integrate backupsync into your Rust project, add it to your Cargo.toml:

[dependencies]
backupsync = "0.1.0"
Example Rust Code:
rust
Copy
use backupsync::backup;

fn main() {
    backup("/home/user/Documents", "/home/user/Backup").unwrap();
}

πŸ› οΈ Contributing

Want to improve BackupSync? Feel free to:

Open an issue for feature requests. Submit a pull request with improvements.

Happy Backing Up! πŸŽ‰

About

lightweight and efficient backup and sync tool

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages