A fast and simple CLI tool for backing up files and folders with automatic timestamping.
Quick File Backup is a lightweight Python utility that allows you to quickly backup important files and directories to a designated location. Each backup is automatically timestamped, making it easy to track and manage multiple backup versions.
- ✅ Backup individual files or entire directories
- ✅ Automatic timestamp-based backup folders (YYYYMMDD_HHMMSS)
- ✅ Human-readable file size display
- ✅ Cross-platform compatibility (Windows, macOS, Linux)
- ✅ Error handling with clear user feedback
- ✅ Preserves file metadata (timestamps, permissions)
- ✅ Simple and intuitive command-line interface
- Clone this repository or download the script
- Ensure you have Python 3.6 or higher installed
- No additional dependencies required (uses only standard library)
python quick_file_backup.py <source> [destination]Backup a single file (creates backups folder in current directory):
python quick_file_backup.py myfile.txtBackup a single file to a specific location:
python quick_file_backup.py myfile.txt /path/to/backupsBackup an entire folder:
python quick_file_backup.py myfolderBackup to a custom destination:
python quick_file_backup.py important_folder /external/drive/backups- The script creates a timestamped backup directory (e.g.,
backup_20231018_143022) - Copies the source file or directory to this backup location
- Preserves original file metadata
- Reports the operation status and backup size
==================================================
Quick File Backup Tool
==================================================
Backup location: backups/backup_20231018_143022
✓ Backed up: myfile.txt (2.45 MB)
✓ Backup completed successfully!
Location: backups/backup_20231018_143022
- Python 3.6+
- Standard library modules:
osshutilsysdatetimepathlib
This project is part of the 100 Lines of Python Code challenge. Contributions should follow the repository's contributing guidelines.
This project addresses issue #1014 from the 100LinesOfPythonCode repository.
This project follows the license of the parent repository.
- Use absolute paths for critical backups
- Regular backups help prevent data loss
- Consider automating with cron jobs or scheduled tasks
- Test restore procedures periodically