0
我想用我的批处理程序压缩文件,但我坚持下面的问题,这是一个服务器日志文件,总是获取数据填充服务器,我们需要保持运行。没有其他办法,我需要在使用它时压缩这个文件。我想强制执行此操作,请给我一个解决方案。Windows批处理命令执行问题文件被另一个进程使用
Weblogic服务器不支持“.out”文件,它只适用于“.log”文件。我们目前的问题是要压缩这个.out文件
效用我打电话的脚本 “C:\ Program Files文件\的7-Zip \ 7z.exe” 一-tzip NewArchive.zip new_ManagedServer_1.out
> 7-Zip [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04
>
> Scanning the drive: 1 file, 25972 bytes (26 KiB)
>
> Creating archive:
> C:\Oracle\Middleware12c\Oracle_Home\user_projects\domains\base_domain\servers\new_ManagedServer_1\logs\new_ManagedServer_1-07252017-223920.zip
>
> Items to compress: 1
>
>
> WARNING: The process cannot access the file because it is being used
> by another process.
> C:\Oracle\Middleware12c\Oracle_Home\user_projects\domains\base_domain\servers\new_ManagedServer_1\logs\new_ManagedServer_1.out
>
>
> Files read from disk: 1 Archive size: 22 bytes (1 KiB)
>
> WARNINGS for files:
>
> C:\Oracle\Middleware12c\Oracle_Home\user_projects\domains\base_domain\servers\new_ManagedServer_1\logs\new_ManagedServer_1.out
> : The process cannot access the file because it is being used by
> another process.
> ---------------- WARNING: Cannot open 1 file The process cannot access the file because it is being used by another process.
不幸的是,Weblogic服务器并不为“.out”文件提供便利,它仅适用于“.log”文件。我们目前的问题是压缩这个.out文件。 –
请查看http://robin4444.blogspot.de/2011/11/rotate-out-log-files.html – stephan14x
这需要在Windows环境中完成,我们已经熟悉的解决方案#2“unix LogRotate”实用程序在我们的一个环境中,我们正在使用它。其次,不重定向到server.log文件的原因是因为我们主要引用.out日志中的任何错误,所以对我们来说这是必须的。 –