brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: rclone size tells you how much a remote folder holds

Rclone
~/tips/tip-rclone-size

rclone size remote:photos

Prints the total size and number of objects at a remote path, optionally as JSON.

Before I move or back up a cloud folder, I want to know how big it is. Clicking through a web interface is slow, and rclone size answers in one line.

rclone size remote:photos

It counts the objects at the path and prints the total size and the number of objects. It recurses by default, so add --max-depth 1 if you only want the top level. For scripts, --json prints the result as JSON.

rclone size remote:photos --json --min-age 30d

The usual filter flags apply, such as --min-size, --max-age and --exclude, so you can measure just a slice of a remote. On big remotes --fast-list can help, at the cost of more memory.

One caveat from the docs: some backends don’t report file sizes, with Google Photos and Google Docs as examples. rclone logs a notice with the number of such files and counts them as empty, so the total can be lower than reality. The command exists since v1.23.

For a visual overview there is also rclone ncdu, and rclone tree for a listing. The size command is the one to put in a script, since it prints one result and exits.

Further reading: rclone size

More Rclone tips rclone copyurl https://example.com/files/big.iso remote:isos -a rclone config redacted rclone ncdu remote:backup rclone copy /data remote:data --bwlimit "08:00,1M 18:00,5M 23:00,off" -P rclone lsf -R --files-only --format tsp remote:photos All Rclone tips (14) All topics

Link