1
我正在執行以下7 Zip命令,這需要大約3-4小時才能完成,然後使用$ lastexitcode確保壓縮成功。這是做這件事的正確方法嗎?我發現$ lastexitcode不總是爲0,但壓縮文件看起來很好。
別的什麼可以修改此退出代碼?
& $7z a -tzip -mx=1 $destinationdir\$today.zip $destinationdir\$db1 >$null 2>&1
if ($lastexitcode -ne 0){
...
在 '> $空2> & 1' 只是用來所以我不認爲從7拉鍊的輸出。
感謝您的任何幫助。
關於7zip的退出代碼:HTTP:// 7zip的.bugaco.com/7zip/MANUAL/exit_codes.htm –
@DavidBrabant +1。這裏是源代碼中的退出代碼定義:[ExitCode.h](https://github.com/pornel/7z/blob/master/CPP/7zip/UI/Common/ExitCode.h)。 – beatcracker