--order-by primary, secondary sorting

What is the problem you are having with rclone?

I don't have a problem only a question.

What is your rclone version (output from rclone version)

rclone v1.53.3
- os/arch: linux/amd64
- go version: go1.15.5

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Debian

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy /local/folder remote:/folder --order-by 'modtime,asc,size,descending'

I was wondering does a command such as the one above with the --order-by flag like that work? or does order-by only take one sort criteria and isn't able to do a secondary sort.

--order-by only takes a primary key at the moment. Files having the same modtime is quite rare though I think.

@ncw Oh yes I agree about files having the same modtime being rare.

But what I wanted to do was to upload the oldest and largest files first.

As I am only able to sort once, I can upload the oldest files, but some of these may not be the largest, or upload the largest but some of these may not be the oldest.

1 Like

I see. That isn't really a secondary sort criteria... You'd want some sort of sort function which added together age and size and sorted on that number. I'm afraid you'll have to stick with one or the other at the moment.

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