'bsdtar in Windows 10: Why is a 9-year old data file "open"? AppData\Local\Microsoft\Internet Explorer\MSIMGSIZ.DAT

I am testing the ability of tar in Windows 10 to be used to occasionally backup a copy of a User profile under C:\Users\Username in a script. But its utility is extremely limited unless there are some workarounds. I have successfully archived the Roaming and LocalLow portions, with some work(arounds).

But I do not see a way to have tar ignore errors and keep trudging through a large, mine-infested hierarchy of open files, locked files, and files without user permissions. I used --exclude pattern to avoid the errors. After several fits with several locked *.db files scattered through the AppData folder, I came across this enigma. C:\Users\Admin\AppData\Local\Microsoft\Internet Explorer\MSIMGSIZ.DAT throws

tar: Couldn't open C:/Users/Admin/AppData/Local/Microsoft/Internet Explorer/MSIMGSIZ.DAT: Permission denied tar: Error exit delayed from previous errors.

But why would that file be open? Its file date is 2013-06-06. M$ explains its purpose in this ancient blog entry from 2011. I checked permissions on the file, and Admin has full. It's not hidden or system or special in any way. I am not running IE. While its seemingly impossible for this file to be in use, it joins several others in the AppData hierarchy which are legitimately in use and which I have meticulously identified for adding to my excludes.

And so while I am working through the numerous kinks in my attempt at profile folder backup, here are a few commandlines that I've used to perform the backup to an F: drive. The numerous --exclude patterns are for working around "open" files which caused tar to exit.

tar -cvz --exclude "OTele" --exclude "OneDrive" --exclude *.dll --exclude "Catalog1.*" --exclude "SolutionPackages" --exclude "C:/Users/Admin/AppData/Local/Microsoft/Windows/*.*" --exclude "Notifications" --exclude "usrClass.*" --exclude "WindowsApps" --exclude "NvBackend" --exclude "NVIDIA Corporation" --exclude "C:/Users/Admin/AppData/Local/Packages" --exclude cache2 --exclude "VERIZON" --exclude "Zoom" --exclude "C:\Users\Admin\AppData\Local\Temp" --exclude *.tmp --exclude *Cache* --exclude *Temp* --exclude "Old Firefox Data" -f f:\appdata-local.tar.gz "C:\Users\Admin\AppData\Local" (It saves about 200MB of archive before failing)

Here is sample output from trying just this one problematic IE folder:

F:\>tar -cvz -f f:\appdata-local-IE.tar.gz "C:\Users\Admin\AppData\Local\Microsoft\Internet Explorer"
tar: Removing leading drive letter from member names
a Users/Admin/AppData/Local/Microsoft/Internet Explorer
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/brndlog.bak
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/brndlog.txt
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/CacheStorage
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/DomainSuggestions
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/DOMStore
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/EmieBrowserModeList
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/EmieModeList
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/EmieSiteList
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/EmieUserList
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/EUPP
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/ie4uinit-ClearIconCache.log
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/ie4uinit-show.log
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/ie4uinit-UserConfig.log
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/IECompatData
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/IEFlipAheadCache
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/imagestore
a Users/Admin/AppData/Local/Microsoft/Internet Explorer/Indexed DB
tar: Couldn't open C:/Users/Admin/AppData/Local/Microsoft/Internet Explorer/MSIMGSIZ.DAT: Permission denied
tar: Error exit delayed from previous errors.

Does anyone know how to either:

  1. Force tar to ignore permission denied errors
  2. Determine aforehand which files will cause the errors and then feed that list to tar?


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source