I want to create a zip to backup a folder.
I want to exclude some files and folders, so I create filter…
Problem, files are exclude but folders persist.
Here my command
Copy ARCHIVE=.zip "c:\test" TO="c:\" CREATEFOLDER="Test_folder_Backup_{date|yyyy-MM-dd}_{time|HHmmss}.zip" FILTER="Test"
Here my 'Test' filter
Here 'Test' folder and zip result
Can I have some help about this please
Leo
December 16, 2018, 9:50am
4
Is Emplacement in French the "Path" clause or the "Full Path" one?
You need to be using "Full Path" for your filter to avoid including those two extra folders, else you're only testing their parent paths.
Yes, "Emplacement" is "Path" and "Emplacement complet" is "Full Path" .
I already tried "Full Path" but it does not work. Folders are not excluded.
Leo
December 16, 2018, 12:07pm
6
I think it's a limitation of the filtering the zip code supports, and it may only let you filter out files not folders.
Doing a quick test with 7z, it filters out folders, although it did still include one which had child folders, which I think is a bug on my part.
jhn
March 23, 2023, 10:26am
7
Bumping this topic, was it resolved by any chance? I have the same situation where I use a filter to exclude certain folders and date from the zip archive. It works ok-ish, the files are not copied, but the empty folders remain.
Thanks!
Leo
March 23, 2023, 1:21pm
8
Zip likely still only excludes files, not folders. But the empty folders won't take up much space.
You could do a filtered copy and then zip the result if it's important to avoid the empty folders.
jhn
March 23, 2023, 2:10pm
9
Thanks @Leo I will look into it. Not super important, just OCD.