Usage
python main.py
ZBackup is launched with a single command. It then presents an interactive menu where you select the operation you want to perform.
Menu Commands
Create Backup
Core
Creates a new ZIP backup of your selected directory. You will be prompted to choose the source directory and provide a name for the backup.
? Select directory to backup: /path/to/project
? Backup name: my-backup
> Creating backup...
Backup created: backups/my-backup_2026-07-27.zip (2.4 MB)
List Backups
Core
Displays all available backups with their names, dates, and sizes. This helps you find the right backup to restore.
> Available Backups:
1. my-backup_2026-07-27.zip (2.4 MB) - 2026-07-27
2. project-v1_2026-07-25.zip (15.1 MB) - 2026-07-25
3. configs_2026-07-20.zip (12 KB) - 2026-07-20
Restore Backup
Core
Restores files from a selected backup. You will be prompted to pick a backup from the list, then the files are extracted to the chosen location.
? Select backup to restore:
> my-backup_2026-07-27.zip
? Restore to directory: /path/to/restore
> Restoring backup...
Restored 42 files successfully.
Delete Backup
Core
Permanently removes a backup file after confirmation. This action cannot be undone.
? Select backup to delete:
> my-backup_2026-07-27.zip
? Are you sure? (y/n): y
> Backup deleted.
Exit
Core
Exits ZBackup cleanly.
Project Structure
ZBackup/
├── image/
│ └── logo.png
├── systeme/
│ ├── linux.py # Linux-specific operations
│ └── win.py # Windows-specific operations
├── main.py # Entry point
├── setup.py # Package configuration
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── README.md # Project documentation
File Formats
| Format | Description |
|---|---|
.zip | Standard ZIP archive. Used for all backup files. Compatible with any ZIP tool. |
.py | Python source files. ZBackup is written entirely in Python. |
.txt | Plain text. Used for requirements.txt and configuration files. |
Error Codes
| Code | Description |
|---|---|
NoBackups | No backups found in the backup directory. |
InvalidPath | The selected directory does not exist or is not accessible. |
DiskFull | Not enough disk space to create the backup. |
ZipError | Error during ZIP creation or extraction. Usually caused by file permissions. |