For several years we’ve used a basic data backup program that exploits the archive bit on files to determine if they need to be backed up or not. We run a weekly full backup with daily differentials. After the weekly backup is run, the archive bit is reset on all files, ready for the next week.
Except it isn’t.
It turns out that if the file has both the system and hidden bit set, you can’t change any of the attributes. This is apparently a known issue that goes right back to the attrib command back in the MS-DOS days.
The end result is that our differential backups end up full of seemingly empty directories that simply don’t need to be there. The usual culprit is a hidden desktop.ini or thumbs.db file.
The simple solution would of course be to run the attrib -a /s /d command on the drive after the weekly backup has completed. But as we now know, that doesn’t work:
PowerShell to the Rescue!
Continue reading ‘Use PowerShell to clear stubborn file attributes’ »