7zip command line batch script including extra folders

457 Views Asked by At

I am trying to figure out why this batch script is containing extra folders. This is part of a daily backup that runs on windows.

set cur_yyyy=%date:~10,4%
set cur_mm=%date:~4,2%
set cur_dd=%date:~7,2%
set ts=%cur_yyyy%-%cur_mm%-%cur_dd%

cd F:\_htdocs
"C:\Program Files\7-Zip\7z.exe" a -t7z "F:\_7z\%ts%_backup.7z" "F:\_htdocs" -r -mx=7

Basically when this script runs I need it to contain only the _htdocs folder and what is inside it. For some reason, 7zip will randomly include other folders.

I've noticed too when watching the script runs it seems to scan everything on the F drive and gives some errors like folder not accessible, etc. As if it's trying to include extra folders.

0

There are 0 best solutions below