I am creating a small backup script for my personal use, and it works at 99% on the latest version of 7zip, Win7x64 :
:: u : Update archive
:: -t7z : Use 7z file type (less compatible and smaller results)
:: -mx=9 : “Ultra” compression
:: -ms=off : Do not create solid archive (they are incompatible with update archive mode)
:: -mmt=off : Enable multithreading
:: -r : Recursive (traverse all subdirectories)
:: -ssw : Compress locked files
:: -w : Working dir to G: drive (no temp file copy from disk to disk)
@echo “%userprofile%\Desktop” >> list.txt
@echo “%userprofile%\Documents” >> list.txt
@echo “%userprofile%\Downloads” >> list.txt
@echo “%userprofile%\Saved Games” >> list.txt
@echo “%userprofile%\Pictures” >> list.txt
“C:\Program Files (x86)\7-Zip\7z.exe” u -t7z -mx=9 -ms=off -mmt=on -r -ssw -wg: “G:\AutoSaveC\SaveC.7z” @list.txt
del list.txt
shutdown -s -t 180
There are two problems tho :
1- Even though the archive contains all expected folders and files, it also contains stuff never intended to be there (only part of the files from the original folders) :
%userprofile%\AppData
%userprofile%\Music
2- It also gives me warnings about denied access to folders I NEVER told it to look at :
C:\Users\LocalAdmin\AppData\Local\Application Data\: WARNING: Access denied.
C:\Users\LocalAdmin\AppData\Local\ElevatedDiagnostics\: WARNING: Access denied.
C:\Users\LocalAdmin\AppData\Local\History\: WARNING: Access denied.
C:\Users\LocalAdmin\AppData\Local\Temp\msdtadmin\: WARNING: Access denied.
C:\Users\LocalAdmin\AppData\Local\Temporary Internet Files\: WARNING: Access denied.
C:\Users\LocalAdmin\Application Data\: WARNING: Access denied.
C:\Users\LocalAdmin\Cookies\: WARNING: Access denied.
C:\Users\LocalAdmin\Local Settings\: WARNING: Access denied.
C:\Users\LocalAdmin\Recent\: WARNING: Access denied.
C:\Users\LocalAdmin\SendTo\: WARNING: Access denied.
Do you know what I’m doing wrong ? Or is it a bug from 7zip ?
Consider that there may be soft links to files in those directories. The Users folder in particular is filled with virtual paths. There are paths in there that exist solely to redirect older applications that still use them to the proper location.