everyone.
I was using Robocopy and WinRAR in a CMD batch script. I was surprised to see the log file was huge and full of bloat. The WinRAR bloat was not that bad. However, the Robocopy output was so bloated. Because it copies large files (300+ GB).
Here is the Robocopy command that I use:
robocopy /Z /B /ZB /J /X /V /TS /FP /ETA /TEE /LOG+:"C:\log.txt" "D:\Data" "E:\Data"
Here is what the output of Robocopy looks like in the log file (Deleted most lines to summerize the issue):
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Sunday, February 12, 2023 9:42:25 AM
Source : D:\Data
Dest : E:\Data
Files : *.*
Options : *.* /V /X /TS /FP /TEE /DCOPY:DA /COPY:DAT /ZB /J /ETA /R:1000000 /W:30
------------------------------------------------------------------------------
3 D:\Data
Newer 39.1 m 2023/02/12 00:00:25 D:\Data\abc.iso
0.1%
0.2%
0.4%
0.5%
0.7%
0.8%
1.0%
1.1%
1.3%
1.4%
1.6%
1.7%
1.9%
2.0%
2.2%
2.3%
2.5%
2.6%
2.8%
2.9%
3.1%
3.2%
3.4%
... (Deleted the lines between because they are too long)
97.1%
97.2%
97.4%
97.5%
97.7%
97.8%
98.0%
98.1%
98.3%
98.4%
98.6%
98.7%
98.9%
99.0%
99.2%
99.3%
99.5%
99.6%
99.8%
99.9%
100%
Here is the WinRAR command:
rar a -ag -ep -m5 -md1024m D:\compressed_data D:\data.iso -p1234 >> C:\log_compress.txt
And this is the output of the WinRAR command stored in the log file:
RAR 4.20 Copyright (c) 1993-2012 Alexander Roshal 9 Jun 2012
Trial version Type RAR -? for help
Evaluation copy. Please register.
Creating archive D:\compressed_data20230211160436.rar
Adding D:\data.iso 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% OK
Done
As you can see, the percentages are bloating the log file regardless what command it occurs with. What I want to achieve is, How can I log the commands without those unnecessary repeated percentages that are filling up the log files?
To remove the precentage bloat from the ROBOCOPY command it is done by adding
/NPswitch. Thanks to @Stephan's comment for resolving this issue.To remove the precentage bloat from the WinRAR command it is done by adding
-idpswitch. Thanks to @Mofi's comment for resolving this issue.