I'm asking here on Stack Overflow because of this.
I have created a "generic" repository on Artifactory, to contain ZIP-files. Originally these zipfiles were on a webserver (either Apache or Nginx) with an indexed directory. It made more sense to have all binary downloads on the same server (we also have Maven, NuGet and Eclipse repos), hence the move.
On the webserver, the zipfiles had the Last Modified date from when they were originally uploaded.
On Artifactory, the zipfiles have the Last Modified date from when they were deployed, i.e. they are all deployed today.
How can I change the Last Modified date in Artifactory back to the original date? I have looked at the documentation of the Properties page, but it's not obvious to me if this is where I need to make the changes.
Or can I do something like
touch -m -t [[CC]YY]MMDDhhmm[.SS] file.zip
somewhere in the backend of Artifactory?
Edit:
This is the content of /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
In /usr/local/artifactory/data/filestore
I have hex numbered directories and files, with no relation to the original filenames. However, running
find /usr/local/artifactory/data/filestore/ -type f -print0 \
| xargs -0 file \
| cut -d: -f2 \
| sort \
| uniq -c \
| sort -nr
tells me that these are indeed the files I'm interested in:
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
For the uninitiated: jar files and nuget files are actually zip files; POM-files are actually xml files, etc. I also randomly opened a few files to confirm his.
This leads me to assume that I might be able to do it by running queries on the Derby database, to find out which binary blob in the filestore
directory I need, and then running the touch -m
command?
So my question is: how do I find out which binary blob in the filestore
directory corresponds with which file? The rest I can figure out for myself.
Of course this assumes that Artifactory takes the filesystem date and doesn't store a date in it's Derby database. I don't know. If it does, then I'm back to square 1.