When I was 16 years old or so, one day, my computer didn’t boot. I got a blue screen with some white text-mode error. Something was broken with the file system. This was after being utterly disappointed by Windows 95 and before I became a Linux person, so I was running Windows NT 4.0. I was the only person I knew running that operating system, and thus the only person I knew with an NTFS partition.
What to do now? That was my only computer, thus I couldn’t get online, smartphones wouldn’t be invented for another decade, I had nobody to ask for help and no tools to run checks on an NTFS partition. That filesystem was quite new back then. I could just blank the hard drive and reinstall Windows NT and all the software. But what about my data? my data!!!
At 16 years old I learned the lesson that the data is the most valuable and important thing inside my computer. Everything is replaceable. I’m sure if I could see that data now I would life, but for 16-year-old-me, that was my life. I started making backups and since that day I had a personal backup strategy that’s more robust than 90% of the companies I talk to. I have yet to lose a file and I hope to keep it that way. My ex-wife recently recovered from a complete computer failure because she’s following the backup strategy I set up for her.
One of the things I wonder is, should I have to do a total restore of my data, how do I verify it? I have more than 2 million files. Big chunks could be missing and it might take me years to notice. Because I have so much data to backup, keeping my 3 backups all up to date is hard, so it’s possible that I may have to reconstruct my information piecing things together from the 3 of them. Technically my backup software should be able to do it. But… I’m skeptical.
This is why every night I have an automatic script that generates a list of all of my files in a text file. That text file gets backed up and unless that files gets permanently and historically lost, I can use it to verify a backup restore. I think my friend Daniel Magliola gave me this idea.
Since I use Windows (shocker, I know, but try building a Mac workstation with 6 screens and play video games and report back to me), I wrote the script in PowerShell, but since I couldn’t find anything like Linux’s find
, the script invokes wsl
. Here it is, normally I put it in c:\Users\pupeno\.bin\filelist.ps1
:
echo "Creating list of all files in C:"
wsl find /mnt/c/Users/pupeno -type b,c,p,f,l,s > C:\Users\pupeno\.all-files.new.txt
move -Force C:\Users\pupeno\.all-files.new.txt C:\Users\pupeno\.all-files.txt
echo "Creating lists of all files in D:"
wsl find /mnt/d -type b,c,p,f,l,s > D:\.all-files.new.txt
move -Force D:\.all-files.new.txt D:\.all-files.txt
echo "Creating lists of all files in E:"
wsl find /mnt/e -type b,c,p,f,l,s > E:\.all-files.new.txt
move -Force E:\.all-files.new.txt E:\.all-files.txt
And this is how it’s configured in the Task Scheduler to run every night. First run Task Scheduler:

Once it’s open, create a new task:




I hope it helps.
Leave a Reply