Returns volume file access time infos
918
This container will return file access/modification time infos. It's mainly used to retrieve the last file access time or file modification time of a docker volume. Per default, you get a summary in JSON format.
The docker run command must be used with the target volume mounted as /volume in the container.
example:
docker run --rm -v $myvolume:/volume camptocamp/volume_info
this will output something like:
{
"isEmpty": false,
"lastAccess": {
"path": "/volume/test1",
"fileName": "test1",
"time": "2017-01-14T16:52:53+01:00",
"since": 547
},
"lastModify": {
"path": "/volume/test",
"fileName": "test",
"time": "2017-01-14T16:52:20+01:00",
"since": 580
},
"mountPoint": "/volume"
}
Should you need to get unique values, you can use the 'jq' binary to filter the output.
docker run --rm -v $myvolume:/volume camptocamp/volume_info | jq .lastAccess.since
will return the nuber of seconds since last access. Here it will be 547
docker run --rm -v $myvolume:/volume camptocamp/volume_info | jq .lastModify.time
will return the date/time of the last modification. Here it will be 2017-01-14T16:52:20+01:00
Should you need also the ctime and btime, you can enable it with the ALL_TIMES environment variable.
example:
docker run --rm -e ALL_TIMES=true -v $myvolume:/volume camptocamp/volume_info
this will output something like:
{
"isEmpty": false,
"lastAccess": {
"path": "/volume/test1",
"fileName": "test1",
"time": "2017-01-14T16:52:53+01:00",
"since": 547
},
"lastBirth": {
"path": "/volume/test1",
"fileName": "test1",
"time": "2017-01-14T16:42:56+01:00",
"since": 1144
},
"lastChange": {
"path": "/volume/test",
"fileName": "test",
"time": "2017-01-14T16:52:20+01:00",
"since": 580
},
"lastModify": {
"path": "/volume/test",
"fileName": "test",
"time": "2017-01-14T16:52:20+01:00",
"since": 580
},
"mountPoint": "/volume"
}
You can use the centurylink/golang-builder to build this utility
docker run --rm -v $(pwd):/src centurylink/golang-builder
Content type
Image
Digest
Size
615 kB
Last updated
over 9 years ago
docker pull msutter/volume_info