Hi everybody,
I use ‘Restic ls’ to see the content of my snapshots. Without json flag, I can see
drwxrwxr-x 1000 1000 0 2021-04-29 20:48:56 /sources/.truc/.machin
-rw-rw-r-- 1000 1000 17 2021-04-30 00:56:46 /sources/.truc/.machin/super.txt
For me, as linux user, no problem for that.
When I use the json flag, I can see :
{"name":".machin","type":"dir","path":"/sources/.truc/.machin","uid":1000,"gid":1000,"mode":2147484157,"mtime":"2021-04-29T18:48:56.637091998Z","atime":"2021-04-29T18:48:56.637091998Z","ctime":"2021-09-25T13:46:33.254747234Z","struct_type":"node"}
{"name":"super.txt","type":"file","path":"/sources/.truc/.machin/super.txt","uid":1000,"gid":1000,"size":17,"mode":436,"mtime":"2021-04-29T22:56:46.004718365Z","atime":"2021-04-29T22:56:46.004718365Z","ctime":"2021-09-25T13:46:33.254747234Z","struct_type":"node"}
Here, no “drwxrwxr-x”, but a property “mode” with “strange” value. After using my brain a long time, I find the idea to change the base of the number. For the file, 436 becomes 664. All right. But with the directory it becomes 20000000775.
I don’t know how to correctly deal with this value. Yes I can extract the 3 last chars to have the user-group-other permissions, and with the “type” to “dir” I can calculate “drwxrwxr-x” but it’s my interpretation. How it will work with links, sticky bits ? It’s magic for me.
Note that for with the “find” command, I can found either “mode” either “permissions”. That is greater for me, and it can be good to normalize that
Regards,