--size flag for lsjson

I found ncdu, which is really cool. But I am in need of something programmatic.

For right now, I've scripted up a tool to do this, but the gist is: lsjson to get the path, loop each path to create a new json output with the size data:

> rclone lsjson remote:some/path --dirs-only -R | jq
...Truncated

> ./myloopscript
[
  {
    "Path": "folder1",
    "Name": "folder1",
    "Size": -1,
    "MimeType": "inode/directory",
    "ModTime": "2020-05-08T21:09:51.426Z",
    "IsDir": true,
    "ID": "1FhSh3qaqh1XOyFHWAZuoTn_hi3V8ND3F"
    "SizeData":
      {
        "count":12,
        "bytes":26132229,
        "sizeless":0
    }
  },
  {
    "Path": "folder2",
    "Name": "folder2",
    "Size": -1,
    "MimeType": "inode/directory",
    "ModTime": "2020-05-08T12:27:02.346Z",
    "IsDir": true,
    "ID": "11WfJ9r40t0HXwRxt3YJ_GJyksoJ_4smi"
    "SizeData":
      {
        "count":20,
        "bytes":1697834,
        "sizeless":0
    }
  },
  {
    "Path": "folder3",
    "Name": "folder3",
    "Size": -1,
    "MimeType": "inode/directory",
    "ModTime": "2020-05-08T09:02:04.801Z",
    "IsDir": true,
    "ID": "1sMxJnv1pkJ7OVSR2dp40fXFLt9K_kl1n"
    "SizeData":
      {
        "count":37,
        "bytes":494628495,
        "sizeless":0
    }
  }
]

Do you think it's valid to work on a --size flag for the lsjson command which combines the lsjson and appropriate size command into 1 output?

I can not talk for others but this --size option would make my small project I am working on much easier:)

1 Like

are you talking about rclonebrowser? :wink:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.