批处理文件 - 需要一个替代的7-Zip - 不能动 [英] Batch file - Need an Alternative to 7-zip - cannot move

查看:206
本文介绍了批处理文件 - 需要一个替代的7-Zip - 不能动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅下面的更新答案

Windows批处理文件。

Windows Batch files.

我绝对爱7-Zip的伟大工程,但像WinZip的移动能力和时间戳的文件。然而,WinZip的(命令行界面)有局限性的文件的大小和文件的归档范围内的数量,例如。

I absolutely love 7-Zip and works great, but like WinZip's ability to move and timestamp files. However, WinZip's (command-line interface) has limitations for the size of files and the quantity of files within an archive, for example.

谷歌搜索我们确实看到有一个人,谁没有采取的7-Zip code和已重新编译code使用一个-m(移动)开关。不过,我感到不舒服关于使用第三方的7-Zip在我们的生产环境中的开发者之外。

Googling we do see that there is a person, who did take 7-zip's code and has re-compiled the code to use an -m (move) switch. However, I don't feel comfortable about using a third-party outside of the Developer of 7-zip in our Production environment.

另外,我所看到的 - http://alternativeto.net/software/7-zip/

Also, I have seen - http://alternativeto.net/software/7-zip/

我有codeD:
IF NOT ERRORLEVEL 1(后邮编进程)要删除的文件,但如果有相同的文件名结构的多个,这不可能是安全的。

I have coded: IF NOT ERRORLEVEL 1 (after the Zip process) to delete the file, but this cannot be safe if there are multiple of the same file name structure.

下面是code的一些样本位:
7zip的:

Here are some sample bits of code: 7zip:

D:\scripts\7za -tzip -y a D\zips\20140116_someclient_%computername%@%location%.zip D:\logs\apache_log.2014-01-16* >nul >>%logfile%
IF NOT ERRORLEVEL 1 ECHO Y|DEL D:\logs\apache_log.2014-01-16*

在哪里apache_log.2014-01-16
可以是:

Where apache_log.2014-01-16 could be:

apache_log.2014-01-16.1
apache_log.2014-01-16.2
apache_log.2014-01-16.3

等。

WinZip的

c:\progra~1\WinZip\Wzzip.exe -T -ex -m D\zips\20140116_someclient_%computername%@%location%.zip D:\logs\some_file.2014-01-16* >nul >>%logfile%

我从一个软件需求的角度来看猜,我想有一些的WinZip在7Zip的能力的..我喜欢7Zip的,因为它有与大型档案工作的能力。我喜欢PeaZip我用PowerArchiver很久以前。问题我已经是我带的Apache Tomcat工作的Windows,我们必须来存档日志每小时可超过200-300 MB一个小时,需要保持服务器清除旧的日志。

I guess from a software requirements standpoint, I would like to have some of the abilities of WinZip in 7Zip.. I like 7Zip as it has the ability to work with large Archives. I like PeaZip and I used PowerArchiver many moons ago. Problem I have is that I am working with Apache Tomcat for Windows, and we have to archive off hourly logs that can be over 200-300 MB an hour and need to keep the servers clear of old logs.

希望这会更有意义。

更新:

不要相信我已经回答了我的问题。

Do believe that I have answered my own question..

FOR /F %%F IN ('dir /B "D:\serverlogs\server.log.2014-01-19*"') DO (
D:\work\scripts\7za.exe –tzip –y a "D:\ziplogs\201401109_COMPANY_SERVERNAME@DATACENTER.ZIP" >> D:\WORK\SCRIPTS\LOGS\LOG_20140120.LOG && DEL "D:\serverlogs\%%F"
)

此没有现在工作得很好。

Which this does work well now.

推荐答案

7-ZIP支持新的开关-sdel包括存档后删除文件。最新的Alpha版本,

Latest alpha versions of 7-Zip support new switch "-sdel" to delete files after including to archive.

这篇关于批处理文件 - 需要一个替代的7-Zip - 不能动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆