7zip CLI包含和排除文件列表
问题描述:
我需要在Windows Server 2012 R2上使用7zip设置备份。我有我想要包含的文件列表以及我想要排除的文件列表。7zip CLI包含和排除文件列表
include_list:
\\ REMOTESERVER \ App1的
\\ REMOTESERVER \ App2的
\\ REMOTESERVER \ App3的
exclude_list:
\\ REMOTESERVER \ App1的\ folder \ file1
\\ remoteServer \ App1 \ folder \ file2
\\ REMOTESERVER \ App1的\文件夹\文件3
\\ REMOTESERVER \ App2的\文件夹\文件file1
\\ REMOTESERVER \ App2的\文件夹\文件2
\\ REMOTESERVER \ App2的\文件夹\文件3
我正在使用的命令:
7z.exe a -mx9 -tzip save.zip [email protected]%include_list% [email protected]%Exclude_list%
这会创建存档就好了。但它没有考虑排除列表。没有显示错误。
我需要排除文件,因为它们中的一些是锁定的数据库文件,它们生成我想摆脱的错误级别1退出代码。
谢谢。
答
我认为你需要添加一个“!”指向“-x”和像这样的变量'-x!%Eclude_list%'之间。