BraimeeDotCom
Movie reviews. Tech tips. Bad parenting.
Movie reviews. Tech tips. Bad parenting.
A lot of my clients use the built-in Windows Backup utility to do nightly file backups. The thing that makes me nervous about that is by default, the Windows Backup util will churn out one big backup file and then keep appending/overwriting it from that point on.
The paranoid guy in me goes, “Well what if one night the backup job gets corrupt and THEN the server immediately croaks and has to be rebuilt from the corrupt backup file? Unlikely, but if it happens, I’m screwed!
So after much Googlin’, I’ve hacked together a little script creates a folder with today’s date, changes to the E:\backup directory where the .bkf file gets stored, and then moves it into the folder with today’s date. That way each night of backups gets its own corresponding folder.
Simply replace E: and cd \backup with drives/directories of your choice, then save the file as name-of-script.bat. I recommend running it a few hours after the nightly backup usually completes, just to be safe.
Set MM=%date:~4,2%
Set DD=%date:~7,2%
Set YYYY=%date:~-4%
E:
cd \backup
MD %MM%-%DD%-%YYYY%
move *.bkf %MM%-%DD%-%YYYY%