You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
When giving a large number of files from different directories as the paths argument, it seems to be writing the file over and over again in one execution.
For example, there are lots of directories under c:\logs, like:
C:\Logs\1
C:\Logs\1\This
C:\Logs\1\That
C:\Logs\2
C:\Logs\2\This
C:\Logs\2\That
C:\Logs\3
C:\Logs\3\This
C:\Logs\3\That
...
Each of these directories has many files. If there are 10k files and 1GB data, you will notice that the output zip file will show the size in such a manner:
...
103MB
15MB
75MB
121MB
0MB
30MB
147MB
26MB
...
It seems obvious to me that it's going to compress in such a way:
Compress some of the files in one directory and saved into a zip file.
Open the zip file and try to read it out, delete or truncate the old file, and repeat step 1.
It will take an unacceptable time to finish. Here is the script I used:
$files = ls "C:\Logs*" -Recurse | where { $_.Name -notlike '*.cab'} | select -ExpandProperty FullName
When giving a large number of files from different directories as the paths argument, it seems to be writing the file over and over again in one execution.
For example, there are lots of directories under c:\logs, like:
C:\Logs\1
C:\Logs\1\This
C:\Logs\1\That
C:\Logs\2
C:\Logs\2\This
C:\Logs\2\That
C:\Logs\3
C:\Logs\3\This
C:\Logs\3\That
...
Each of these directories has many files. If there are 10k files and 1GB data, you will notice that the output zip file will show the size in such a manner:
...
103MB
15MB
75MB
121MB
0MB
30MB
147MB
26MB
...
It seems obvious to me that it's going to compress in such a way:
It will take an unacceptable time to finish. Here is the script I used:
$files = ls "C:\Logs*" -Recurse | where { $_.Name -notlike '*.cab'} | select -ExpandProperty FullName
Compress-Archive $files -DestinationPath "C:\Compressed\Logs.zip" -CompressionLevel Optimal
The text was updated successfully, but these errors were encountered: