backupsync ~/Documents ~/Backup Unlike high-level backup software, BackupSync is:
- Download the latest backupsync binary from Releases. Move it to a system-wide location:
sudo mv backupsync /usr/local/bin/- Now, you can run backupsync from anywhere!
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Clone the repository:
git clone https://github.com/YOUR_GITHUB/backupsync.git
cd backupsync
cargo build --release- Move the compiled binary to /usr/local/bin/ (Linux/macOS).
- Install Rust (if not installed):
- Download and install Rust for Windows.
- Restart your terminal after installation.
- Clone the repository: Open PowerShell and run:
git clone https://github.com/lakshyajn/BackupSync.git
cd BackupSync- Build the project:
cargo build --release- Move the binary to system PATH (Optional, for global usage):
$env:Path += ";$PWD\target\release"Run the following command (For Linux,macOS):
backupsync <source_folder> <backup_folder>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- To create a .tar.gz backup instead of raw files:
backupsync ~/Documents ~/Backup tar.gz- To create a .zip backup:
backupsync ~/Documents ~/Backup zip- 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.
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- Open crontab:
crontab -e- Add this line to schedule a daily backup at 2 AM:
0 2 * * * /usr/local/bin/backupsync ~/Documents ~/Backup- Open Task Scheduler (Win + R, type taskschd.msc, press Enter).
- Click Create Basic Task β Name it "BackupSync".
- Set Trigger β Choose Daily or your preferred schedule.
- Set Action β Select Start a program.
- Browse for the backupsync.exe file in your target/release/ folder.
- Add arguments:
"C:\Users\YourName\Documents" "D:\Backup"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();
}
Want to improve BackupSync? Feel free to:
Open an issue for feature requests. Submit a pull request with improvements.