B-Backup is a Bash tool designed to simplify the process of backing up files and directories. It offers a range of features to ensure seamless backup and recovery of data, making it a reliable and user-friendly solution for managing backups.
B-Backup provides the following features:
- Backup: Back up files and directories to a hidden location on the user's system.
- Encryption: Encrypt backups using PKZIP encryption.
- Compression: Compress backups using DEFLATE compression.
- Deletion: Optionally delete original files after backup.
- Restore: Restore backups to the original or a custom location.
- Export: Export backups to a custom location.
- Logging: Log all actions for future reference.
- List Backups: View all backups created by B-Backup.
- Delete Backups: Remove individual backups.
- Search Files: Search for specific files within backups.
- Error Handling: Gracefully handle errors with helpful messages.
- Help Menu: Access detailed help directly from the script.
- Operating System: Tested on Ubuntu 20.04 and Kali Linux 2024.1.
- Bash Version: Minimum tested version is 5.1.16.
- Dependencies:
zip
,unzip
,mv
,rm
,ls
,grep
,echo
,read
,date
,cat
,printf
(all standard tools available on most Linux distributions).
Note: B-Backup cannot run with root privileges. Running the script as root will result in an error message and termination.
- Clone the repository:
git clone https://github.com/IMS-coding-projects/M122-2.git
- Navigate to the project directory:
cd M122-2
- Make the script executable:
chmod +x B-Backup.sh
Run the script using the following command:
B-Backup.sh
- Manage Backups: Create, restore, delete, or search backups.
- Help: Access detailed documentation.
- Display Logs: View the log file.
- Export All Backups: Export all backups to a specified location.
- Uninstall: Remove all backups and logs.
- Exit: Exit the script.
The script has been rigorously tested on various Linux distributions and scenarios. Below are some key test cases:
Test Number | Description | Expected Outcome | Result |
---|---|---|---|
1 | Start the script for the first time. | Creates necessary folders and files. | ✅ Pass |
2 | Create a backup with encryption and compression. | Backup is created successfully. | ✅ Pass |
3 | Restore a backup to the original location. | Backup is restored successfully. | ✅ Pass |
4 | Search for a specific file in a backup. | File is found and can be extracted. | ✅ Pass |
5 | Run the script with root privileges. | Script exits with an error message. | ✅ Pass |
For a full list of tests, refer to the Documentation.
This project is licensed under the MIT License. See the LICENSE file for details.