forked from TrueCloudLab/restic
Merge pull request #4511 from dnnr/inode-in-json
Include inode in JSON output for find and ls
This commit is contained in:
commit
495982232c
4 changed files with 13 additions and 1 deletions
7
changelog/unreleased/pull-4511
Normal file
7
changelog/unreleased/pull-4511
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Enhancement: Include inode numbers in JSON output for find and ls
|
||||||
|
|
||||||
|
Restic used to omit the inode numbers in the JSON messages emitted for nodes by
|
||||||
|
the `ls` command as well as for matches by the `find` command. It now includes
|
||||||
|
those values whenever they are available.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/pull/4511
|
|
@ -126,7 +126,6 @@ func (s *statefulOutput) PrintPatternJSON(path string, node *restic.Node) {
|
||||||
|
|
||||||
// Make the following attributes disappear
|
// Make the following attributes disappear
|
||||||
Name byte `json:"name,omitempty"`
|
Name byte `json:"name,omitempty"`
|
||||||
Inode byte `json:"inode,omitempty"`
|
|
||||||
ExtendedAttributes byte `json:"extended_attributes,omitempty"`
|
ExtendedAttributes byte `json:"extended_attributes,omitempty"`
|
||||||
Device byte `json:"device,omitempty"`
|
Device byte `json:"device,omitempty"`
|
||||||
Content byte `json:"content,omitempty"`
|
Content byte `json:"content,omitempty"`
|
||||||
|
|
|
@ -87,6 +87,7 @@ func lsNodeJSON(enc *json.Encoder, path string, node *restic.Node) error {
|
||||||
ModTime time.Time `json:"mtime,omitempty"`
|
ModTime time.Time `json:"mtime,omitempty"`
|
||||||
AccessTime time.Time `json:"atime,omitempty"`
|
AccessTime time.Time `json:"atime,omitempty"`
|
||||||
ChangeTime time.Time `json:"ctime,omitempty"`
|
ChangeTime time.Time `json:"ctime,omitempty"`
|
||||||
|
Inode uint64 `json:"inode,omitempty"`
|
||||||
StructType string `json:"struct_type"` // "node"
|
StructType string `json:"struct_type"` // "node"
|
||||||
|
|
||||||
size uint64 // Target for Size pointer.
|
size uint64 // Target for Size pointer.
|
||||||
|
@ -102,6 +103,7 @@ func lsNodeJSON(enc *json.Encoder, path string, node *restic.Node) error {
|
||||||
ModTime: node.ModTime,
|
ModTime: node.ModTime,
|
||||||
AccessTime: node.AccessTime,
|
AccessTime: node.AccessTime,
|
||||||
ChangeTime: node.ChangeTime,
|
ChangeTime: node.ChangeTime,
|
||||||
|
Inode: node.Inode,
|
||||||
StructType: "node",
|
StructType: "node",
|
||||||
}
|
}
|
||||||
// Always print size for regular files, even when empty,
|
// Always print size for regular files, even when empty,
|
||||||
|
|
|
@ -277,6 +277,8 @@ Match object
|
||||||
+-----------------+----------------------------------------------+
|
+-----------------+----------------------------------------------+
|
||||||
| ``group`` | Name of group |
|
| ``group`` | Name of group |
|
||||||
+-----------------+----------------------------------------------+
|
+-----------------+----------------------------------------------+
|
||||||
|
| ``inode`` | Inode number |
|
||||||
|
+-----------------+----------------------------------------------+
|
||||||
| ``mode`` | UNIX file mode, shorthand of ``permissions`` |
|
| ``mode`` | UNIX file mode, shorthand of ``permissions`` |
|
||||||
+-----------------+----------------------------------------------+
|
+-----------------+----------------------------------------------+
|
||||||
| ``device_id`` | OS specific device identifier |
|
| ``device_id`` | OS specific device identifier |
|
||||||
|
@ -470,6 +472,8 @@ node
|
||||||
+-----------------+--------------------------+
|
+-----------------+--------------------------+
|
||||||
| ``ctime`` | Node creation time |
|
| ``ctime`` | Node creation time |
|
||||||
+-----------------+--------------------------+
|
+-----------------+--------------------------+
|
||||||
|
| ``inode`` | Inode number of node |
|
||||||
|
+-----------------+--------------------------+
|
||||||
|
|
||||||
|
|
||||||
restore
|
restore
|
||||||
|
|
Loading…
Reference in a new issue