因为这个,我在 Stack Overflow 上问。
我在 Artifactory 上创建了一个“通用”存储库,以包含 ZIP 文件。最初,这些 zip 文件位于带有索引目录的网络服务器(Apache 或 Nginx)上。在同一台服务器上下载所有二进制文件更有意义(我们也有 Maven、NuGet 和 Eclipse 存储库),因此采取了这一举措。
在网络服务器上,zip 文件的上次修改日期是从最初上传时开始的。
在 Artifactory 上,zipfile 的 Last Modified 日期是从它们部署时开始的,即它们都是今天部署的。
如何将 Artifactory 中的上次修改日期更改回原始日期?我查看了“属性”页面的文档,但如果这是我需要进行更改的地方,这对我来说并不明显。
或者我可以做类似的事情
touch -m -t [[CC]YY]MMDDhhmm[.SS] file.zip
在 Artifactory 后端的某个地方?
编辑:
这是内容/usr/local/artifactory/etc/storage.properties
type=derby
url=jdbc:derby:{db.home};create=true
driver=org.apache.derby.jdbc.EmbeddedDriver
## Determines where the actual artifacts binaries are stored. Available options:
## filesystem - binaries are stored in the filesystem (recommended, default)
## fullDb - binaries are stored as blobs in the db, filesystem is used for caching
## cachedFS - binaries are stored in the filesystem, but a front cache (with faster access) is added
## IMPORTANT NOTE: This property should not be change after the initial setup. To change binaries storage you have to export and import
#binary.provider.type=filesystem
在/usr/local/artifactory/data/filestore
我有十六进制编号的目录和文件,与原始文件名无关。然而,运行
find /usr/local/artifactory/data/filestore/ -type f -print0 \
| xargs -0 file \
| cut -d: -f2 \
| sort \
| uniq -c \
| sort -nr
告诉我这些确实是我感兴趣的文件:
706 Zip archive data, at least v1.0 to extract
328 XML document text
27 XML document text
26 exported SGML document, ASCII text, with CRLF line terminators
22 Zip archive data, at least v2.0 to extract
16 ASCII text
14 ASCII text, with CRLF line terminators
9 HTML document, ASCII text, with very long lines, with CRLF line terminators
9 HTML document, ASCII text, with very long lines
6 HTML document, ASCII text, with CRLF line terminators
4 HTML document, ASCII text
4 gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT)
4 exported SGML document, ASCII text
3 PE32 executable (GUI) Intel 80386 (stripped to external PDB), for MS Windows
对于外行:jar 文件和 nuget 文件实际上是 zip 文件;POM-files其实就是xml文件等等,我也随便打开了几个文件来确认他的。
这使我假设我可以通过在 Derby 数据库上运行查询来找出filestore
我需要的目录中的哪个二进制 blob,然后运行touch -m
命令来做到这一点?
所以我的问题是:如何找出filestore
目录中的哪个二进制 blob 对应于哪个文件?其余的我可以自己解决。
当然,这假设 Artifactory 采用文件系统日期并且不在其 Derby 数据库中存储日期。我不知道。如果是这样,那么我回到第 1 格。