Simple Backup Utility is a lightweight C++ console application designed to perform file and directory backups based on a list specified in list.txt.
The program automatically handles creating a backup directory and safely copying all listed files and folders.
- Load list of files and directories to back up from
list.txt - Automatic verification and creation (or reset) of the backup destination
- Recursive directory copying with full structure preservation
- Simple and minimal user interaction
- Clear runtime messages and basic error handling
-
Prepare the
list.txtfile
Each line must contain an absolute or relative path to a file or folder you want to back up. Example:/home/user/Documents/report.docx /home/user/Pictures/vacation /home/user/.bashrc -
Build the project
Compile the program using a C++17 (or newer) compliant compiler:g++ backup.cpp -o backup -std=c++17
-
Run the utility
./backup
During execution:
- The program loads the paths from
list.txt. - Asks for the destination path for the backup.
- Prompts you if the destination already exists (overwrite or exit).
- Begins the backup process, reporting progress for each file or directory.
- The program loads the paths from
- C++17-compatible compiler (required for
<filesystem>) - Linux, Windows, or any system supporting C++17 standard libraries
- If
list.txtcannot be opened, the program exits with an error. - If a file or directory from
list.txtis missing, a warning is printed and the backup continues. - Unexpected behavior (such as inaccessible files) is handled gracefully with runtime messages.
This utility is currently under active development. Future improvements and fixes are planned:
- Fix copying root-owned files: Detect and warn when trying to copy files that require elevated permissions.
- Fix crash on missing files: Properly skip and report missing files without throwing exceptions.
- Improve output formatting: Add clearer, cleaner status messages during backup.
- Add logging: Write the entire backup process (successes, failures) into a
log.txtfile. - Command-line arguments: Allow specifying the list file and backup destination via command-line parameters.
- Parallel copying: Optimize performance by adding multithreaded copying for large sets of files.
- Error codes: Exit with appropriate status codes for easy scripting and automation.
- Backup verification: Add optional checksum validation after copying.
- Configuration file support: Allow configuring default settings via a
.conffile. - Progress bar: Show a dynamic progress bar while copying.
- Refactor codebase: Modularize and document code thoroughly for maintainability.
- Cross-platform testing: Ensure full functionality on Linux, Windows, and macOS.
- Always run the program with appropriate permissions for the files you want to back up.
- The backup destination path must be accessible and writable by the user.
- Make sure paths in
list.txtare correct to avoid unnecessary errors.
This project is licensed under the terms of the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for more details.