/Backup_Guardian

Sistema Controle de Backup, envia por FTP / GoogleDriver / AWS / Nass, determinada pasta no sistema, ou varias pastas configuradas para serem copiadas.

Primary LanguageRust

πŸ“¦ Backup_Guardian

Backup_Guardian is a backup management system that allows users to send specific folders or multiple configured folders to storage services such as FTP, Google Drive, AWS, or NAS. This modular system is organized into multiple layers, facilitating integration with various backup services and enhancing process efficiency.

πŸ› οΈ Key Features

  • Automated Backup: Automatically configures backups for designated folders.
  • Multi-Service Support: Compatible with FTP, Google Drive, AWS, and NAS.
  • File Monitoring: Detects file changes and performs backups of modified files.
  • Modular Design: The project is organized into modules, allowing for easy expansion and reuse.

πŸš€ Getting Started

Follow the instructions below to run Backup_Guardian on your machine.

Prerequisites

Before starting, ensure that the following software is installed on your machine:

  • Rust - Required to compile and run the project.
  • Compatible storage services (FTP, Google Drive, AWS, or NAS).

Installation

  1. Clone this repository:

    git clone https://github.com/your-username/Backup_Guardian.git
  2. Navigate to the project directory:

    cd Backup_Guardian
  3. Compile the project in release mode:

    cargo build --release
  4. Run the generated binary:

    ./target/release/painel_load

πŸ“‚ Project Structure

Backup_Guardian/
β”‚
β”œβ”€β”€ common/
β”‚   β”œβ”€β”€ sql_lite/          # SQLite integration module
β”‚   β”œβ”€β”€ dirs/              # Directory management
β”‚   β”œβ”€β”€ notify/            # File change monitoring
β”‚   β”œβ”€β”€ fs2/               # Filesystem management and lock control
β”‚   β”œβ”€β”€ winapi/            # Windows API interactions
β”‚   β”œβ”€β”€ winit/             # Window management in the system
β”‚   └── tray_item/         # System tray icon control
β”‚
β”œβ”€β”€ controller/
β”‚   └── painel_controller/  # Controller for the control panel logic
β”‚
β”œβ”€β”€ view/
β”‚   └── painel_load/        # Graphical interface for the control panel
β”‚
β”œβ”€β”€ Cargo.toml              # Project configuration and dependencies
└── README.md               # Project documentation

πŸ“¦ Dependencies

Here are the main dependencies used in the project, as specified in the Cargo.toml file:

[dependencies]
notify = "6.1.1"
rusqlite = { version = "0.32.1", default-features = false, features = ["bundled"] }
dirs = "5.0.1"
fs2 = "0.4.3"
winapi = "0.3.9"
winit = "0.30.5"
tray-item = "0.10.0"
log = "0.4.22"
  • notify: Used for monitoring changes in files and directories.
  • rusqlite: SQLite database integration.
  • dirs: Directory manipulation.
  • fs2: Extensions for file system manipulation.
  • winapi: Windows API interactions.
  • winit: Window creation and management in the system.
  • tray-item: System tray icon management.

πŸ”§ Project Configuration

This project includes the following optimizations in the Cargo.toml file:

[profile.release]
lto = "fat"
opt-level = "z"
  • **LTO (Link Time Optimization): Optimizes runtime by producing more efficient binaries.
  • opt-level = "z": Optimizes binary size.

🚧 Configuring Backup

To configure file transfers to backup services, access the control panel interface and input the credentials and specific settings for each service.

Supported Backup Modes

  1. FTP: Enter the FTP server address and credentials.
  2. Google Drive: Authenticate your Google account and choose the destination folder.
  3. AWS: Configure access keys and the S3 bucket.
  4. NAS: Define the network path and necessary authentications.

πŸ§ͺ Running Tests

To run unit tests for the project, execute the following command:

cargo test

This will execute all defined tests and display their status.

πŸ› οΈ Future Enhancements

  • Mais ServiΓ§os de Backup: Support for new cloud storage services.
  • RelatΓ³rios de Backup: Detailed reports on performed backups.
  • Agendamento AutomΓ‘tico: Functionality for scheduling periodic backups.

πŸ“„ License

This project is licensed under the terms of the MIT license. See the LICENSE file for more details.