This repository is a "museum" of sorts to document my various solutions throughout the years to programatically backing up my files to an external storage drive. Since these were mostly written for personal use, most of them won't work without modification (ie. changing hardcoded folder paths). However, they are still useful for reviewing programming techniques. My goal is to demonstrate how this project has evolved over time.
2022-03-17_backup-helper.bat: The first script I ever wrote for backing up files. I was halfway through college at the time, but this was a personal project.
There are three modes of operation for backing up different things: general files (documents, pictures, music, and video folders) using WinMerge, Portal 2 custom maps, and Minecraft worlds.
2022-11-26_backup-assistant.ps1: The first version to be written in PowerShell instead of Windows Batch.
Powershell is more modern and I found it more readable. It would stay a PowerShell script for the next two years.
By this point I've improved the script by adding a menu to pick from a preset list of folders to back up, instead of the earlier "all-or-nothing" approach.
I also added a feature to back up PICO-8 projects.
backup-assistant-changelog.txt: Changelog for every version of the script between May 3, 2022 and August 22, 2023.
2024-03-02_Compare-ToBackupDrive.ps1: A shift in design philosophy, this replaces my previous script with a much simpler one that simply passes folder paths to WinMerge.
Note the usage of external script Add-Dependency.ps1 instead of simply adding WinMerge to the system PATH variable.
Also note the parameters for internal drive letter (I used a separate data partition instead of the C drive) and external drive name.
You can see how the paths to both folders to compare are resolved given the single Directory parameter, which is a path to one of them.
20241030_saveme.ps1: The final version to be written in PowerShell.
By now, only the drive names are passed as parameters, and their drive letters are both resolved at runtime.
The given "Directory" path and resolved drive letters are used to compose the final paths to the two folders to compare.
Note by this point I'd also started logging comparisons to a text file.
20250327_compare-to-backup.sh: As I started working with Linux due to my job, this was an experiment to translate my script to UNIX Bash.
20250331_comptool.py: This is when I migrated from Powershell to Python, so I could use the same script on both Windows and Linux.
The script detects whether it's running on Windows or Linux, and has two different "modes" of operation.
On Windows, the script simply calls WinMerge as before.
On Linux, diff is used for a quick, "high-level" comparison, and calls meld if the user wants more details.
Folders to compare are still resolved from a single input path as before.
20251123_comptool.py: The latest version of the script as of writing.
comptool_changelog.txt: Changelog from between the switch to Python and the time of writing.