The Folder Backup Script is a comprehensive backup utility designed to create complete, timestamped copies of folders and their entire directory structures to external storage locations. This script provides a safe, reliable method for backing up important data with detailed progress tracking, error handling, and performance metrics.
Key Features:
Complete directory preservation with full metadata retention
Automatic timestamped naming to prevent backup conflicts
Cross-platform compatibility with Windows 11 optimization
Real-time progress tracking with performance metrics
Comprehensive error handling and recovery mechanisms
Disk space validation before backup operations
Unicode/Emoji support with ASCII fallbacks for enhanced user experience
GUI-based folder selection for ease of use
Detailed backup reporting with operation statistics
Safe overwrite confirmation for existing backups
Primary Use Cases:
Data protection: Regular backups of important folders and projects
Migration assistance: Moving folder structures between storage devices
Archive creation: Timestamped snapshots of folder states
External storage management: Organized backup storage on external drives
Project preservation: Maintaining historical versions of work folders
Windows 11 Optimizations:
Enhanced Unicode and emoji support for modern console experience
UTF-8 encoding configuration for international characters
Windows-specific file handling optimizations
Console appearance improvements with virtual terminal processing
2. Inputs
System Requirements:
Python 3.6+ installed on your system
tkinter (usually included with Python installation)
Standard library modules only (no additional installations required)
File system permissions to read source and write to destination
Sufficient disk space on destination for complete backup
User-Selected Inputs:
The script requires two primary inputs via GUI dialogs:
1. Source Folder Selection
Purpose: The main folder you want to backup completely
Scope: Includes all subfolders and files recursively
Selection: Choose the top-level folder containing all data to backup
Validation: Script verifies folder exists and is accessible
2. External Destination Folder
Purpose: The storage location for backup (typically external drive)
Requirements: Must be different from source folder
Recommendations: External drive, network storage, or different partition
Validation: Script checks accessibility and available disk space
Create full backup path combining destination and timestamped name
Check for existing backup folders and handle conflicts
Source folder analysis:
Calculate total size of all files and folders
Count individual files and subdirectories
Estimate backup duration based on data size
Display comprehensive analysis results
Disk space validation:
Check available space on destination drive
Compare with required space for backup
Prevent backup start if insufficient space available
Step 5: Backup Confirmation
GUI confirmation dialog displays: - Source folder path and analysis results - Destination backup path with timestamp - File count and total size statistics - Proceed/Cancel options for user control
Safety checks:
Verify source and destination are different locations
Confirm adequate disk space availability
Handle existing backup folder conflicts with overwrite confirmation
Step 6: Backup Execution with Progress Tracking
Real-time copy operation:
Copy all files and folders with complete metadata preservation
Display progress every 50 files processed
Show running statistics: files copied, data transferred, speed metrics
Handle individual file errors without stopping entire operation
All files copied with original metadata preserved (timestamps, permissions)
Subdirectory hierarchy maintained identically to source
File attributes preserved including creation and modification dates
Naming convention example:
Source: C:\Users\John\Documents\Projects
Backup: E:\Backups\Projects-2025-07-10--14-30\
Detailed Backup Report:
File: backup_report.txt (saved within backup folder)
Report Structure:
FOLDER BACKUP REPORT
==================================================
Backup Date: 2025-07-10 14:30:15
Source Folder: C:\Users\John\Documents\Projects
Backup Location: E:\Backups\Projects-2025-07-10--14-30
Duration: 0:05:23.456789
BACKUP STATISTICS:
------------------------------
Files Successfully Copied: 1,247
Files Failed: 0
Total Data Copied: 2.34 GB
Average Speed: 7.23 MB/second
SUCCESS: All files copied successfully!
Real-Time Console Output:
Initialization feedback:
🔧 Testing Unicode and emoji support on Windows 11...
✅ Unicode and emoji support: 📁🚀💾⚡🎉
✅ Full emoji support is working correctly!
============================================================
FOLDER BACKUP SCRIPT FOR WINDOWS 11
============================================================
============================================================
BACKUP COMPLETED
============================================================
🕐 Backup finished at: 2025-07-10 14:35:38
⏱️ Total duration: 0:05:23
📁 Files successfully copied: 1,247
❌ Files failed: 0
💾 Total data copied: 2.34 GB
🚀 Average copy speed: 7.23 MB/second
🎉 SUCCESS: Backup completed successfully!
All 1,247 files copied successfully
📁 Your backup is located at:
E:\Backups\Projects-2025-07-10--14-30
📂 Opening backup folder...
Performance Metrics:
The script tracks and displays: - Copy speed: Real-time and average transfer rates - Progress percentage: Files processed vs. total count - Data metrics: Bytes copied with human-readable formatting - Time tracking: Duration and estimated completion times - Error statistics: Failed files and error descriptions
Unicode/Emoji Display:
Full emoji support (when available): - ✅ Success indicators, 📁 Folder symbols, 🚀 Speed indicators - ⚠️ Warnings, ❌ Errors, 🎉 Completion celebrations - 💾 Data symbols, ⏱️ Time indicators, 📊 Statistics
No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law.
For permission requests, write to the publisher at: Email us
Contact Us
If you have any question or comment please contact us at Email us and make sure you add python-book at the beginning of the subject.
[1] "Time taken to run the Quarto document: 0.0906131267547607 seconds"