Backup.c is a robust and user-friendly utility designed to back up files and directories to an external storage device, such as a USB drive. With a focus on simplicity and functionality, this tool provides a seamless way to secure your data on Linux-based systems.
- Core Feature: Backup to external storage devices (e.g., USB drives).
- Development Duration: November 12 - November 24, 2024.
- License: GNU Affero General Public License v3.0.
- GitHub Repository: Backup.c
- Backs up a source directory to a target location.
- Automatically creates a timestamped folder (e.g.,
Backup YYYY-MM-DD HH-MM-SS) in the target directory for better organization. - Recursively copies files and directories while maintaining permissions and structure.
- Allows specifying a custom target directory using the
-tcommand-line option:./backup -t /custom/target /path/to/source
- Saves the specified directory as the new default for future backups.
- Includes visual and functional details, such as random delays and color-coded debug logs, to enhance the user experience.
- Outputs informative messages and warnings for better transparency.
- A Linux-based operating system (e.g., Raspberry Pi OS or other Unix-like systems).
- A C compiler (e.g.,
gcc).
Compile the source code with the following command:
gcc -o backup backup.cRun the program as follows:
./backup [OPTIONS] SOURCE_DIR-t TARGET_DIR: Specifies a custom target directory for backups. Saves this directory as the new default.
Backup the /home/user/Documents directory to the default target:
./backup /home/user/DocumentsSpecify a custom target directory:
./backup -t /mnt/usb /home/user/DocumentsThe program reads the default backup directory from a configuration file located in the user's home directory (e.g., ~/.config/backup_tool.conf). If no configuration exists, the default directory is /media/pi/piBackup.
Each backup is stored in a uniquely named folder based on the current date and time, ensuring backups remain organized and traceable.
The program validates directories, handles unexpected conditions, and provides detailed error messages for troubleshooting.
- Extend compatibility to other Linux distributions by dynamically detecting the system's default external storage path.
- Install the program globally with root privileges for execution without
./and from any directory. - Add features like a progress bar or dramatic warning displays for enhanced interactivity.
- 60%: Because it seemed cool.
- 40%: For project submission.
- 15%: To manage GitHub contributions.
- 5%: Out of necessity.
- Developed by Junsu Lee.
- Contact: junsulee119@gmail.com
Thank you for using Backup.c!