Manual NAS Backup Tool
September 6, 2025 ยท View on GitHub
Author: Daury DiCaprio
License: MIT
Motto: #VERyGoodforlife
A powerful interactive Python script for creating two types of backups: secure, encrypted, versioned backups using Restic, and simple, incremental, direct-access file copies using Rclone.
Creator's Journey & Purpose
This tool was born out of a real-world need: managing project files on a laptop (a Dell XPS) with limited storage. The goal was to create a reliable system to:
- Archive completed projects to an external drive and cloud storage to free up local space.
- Secure critical, in-progress work with versioned, encrypted backups.
Currently, I use it weekly to keep my main machine clean and my data safe across a local HDD and Google Drive. The future plan is to deploy this tool on a dedicated home server (a Beelink NAS with Proxmox) and a Raspberry Pi to create a fully automated, robust, on-site and off-site backup system.
โ Key Features
- Dual Backup Modes: Choose between ultra-secure, encrypted backups or simple, accessible file copies.
- Dual Destination: Back up to a local drive and the cloud in a single, reliable operation (local first, then cloud).
- Interactive & Safe: Guides you through every step with clear prompts and warnings to prevent accidental data loss.
- Flexible: Works with any external drive and any cloud storage service configured with Rclone (Google Drive, Dropbox, etc.).
- Customizable: Allows you to specify custom destination paths for better organization.
๐ ๏ธ Requirements
Before you start, make sure you have these three tools installed:
- Restic: The engine for secure, encrypted backups.
- Rclone: The "swiss army knife" for cloud storage, used as a backend for both backup types.
- FUSE: Required to mount and explore your encrypted backups as a virtual drive (
fuse3on Arch,fuseon Debian/Ubuntu).
๐ Step-by-Step Usage
-
Clone the Repository:
git clone https://github.com/your-username/manual-nas-backup-tool.git cd manual-nas-backup-tool -
Install Dependencies:
- On Arch Linux:
sudo pacman -S restic rclone fuse3 - On Debian/Ubuntu/Raspberry Pi OS:
sudo apt update && sudo apt install restic rclone fuse -y
- On Arch Linux:
-
Configure Rclone: If you want to back up to the cloud, you must configure Rclone first. It's a one-time setup.
rclone configFollow the prompts to add your cloud storage provider (e.g., Google Drive).
-
Make the Script Executable:
chmod +x manual-nas-tool.py -
Run the Tool:
./manual-nas-tool.pyThe script will guide you through the rest! At the end of the first successful run, it will offer to install itself as a system command (
manual-nas-tool) for easy access.
๐ Accessing Your Encrypted Backups
Your secure backups are encrypted databases. You cannot see the files directly. To access them, you use restic to mount the backup as a virtual, read-only drive.
-
Create a mount point (an empty folder):
mkdir ~/my_decrypted_backup -
Mount the repository (example for Google Drive):
# For a cloud backup: restic --repo rclone:<your_remote_name>:manual_nas_encrypted/<project_name>_encrypted/ mount ~/my_decrypted_backup # For a local disk backup: restic --repo /path/to/your/disk/manual_nas_encrypted/<project_name>_encrypted/ mount ~/my_decrypted_backup -
Enter your password when prompted.
-
Explore your files! You can now browse the
~/my_decrypted_backupfolder with your file manager. Look inside thesnapshots/latest/directory. -
Unmount when finished: Go back to the terminal and press
Ctrl + C.
โ ๏ธ THE GOLDEN RULE: SAVE YOUR PASSWORD! The password you use for a secure backup is your only key to your data. If you lose it, your data is gone forever. There is no recovery. Save it in a trusted password manager immediately.
๐ค Automation (Optional)
Simple Automation with Cron
You can run a backup automatically at a set time. Run crontab -e and add a line like this to run a backup every day at 3:00 AM. Note: This works best if your script is modified to be non-interactive.
0 3 * * * /path/to/your/manual-nas-tool.py --non-interactive --source /home/user/projects --dest gdrive --secure
Advanced Automation with Systemd
For better reliability and logging on a dedicated server (like a Raspberry Pi or NAS), using a systemd timer is the modern, professional standard. It's more complex to set up (requiring a .service and a .timer file) but offers huge benefits:
- Superior Logging: Every run is logged in the system journal (
journalctl). - Increased Reliability: It can run a missed backup as soon as the system boots up.
MIT License ยฉ 2025 Daury DiCaprio