[SOLVED] What is the time unit of rclone rc MaxAge

I am trying to set the MaxAge to 1 hour using following command:
rclone rc options/set --json "{\"main\":{\"MaxDepth\":3},\"filter\":{\"MaxAge\":??}}" --rc-addr=<ip:port> --rc-user=<user> --rc-pass=<pass>

However, could not figure out appropriate value for MaxAge key.
Using rclone rc options/get I see that the default value is 9223372036854776000

What is the unit of this number? I made several assumptions (millisec, microsec, nanosec) and test them but no success to find the unit! :thinking:

Also, I wonder if rclone uses modtime or creation time to calculate the age? It seems that It uses modtime. Am I right?

Thanks for the help

It seems that It is nanosec. However, there is some delays. For example if you set MaxAge to 10 min it will return the files with max age of 12 min as well.
Is this a bug!? :thinking:

Nano seconds! This should be documented!

Yes modtime is correct.

It certainly shouldn't do that!

Can you replicate with the command line directly? So rclone ls --max-age 10m?

1 Like

Hi ncw
Thanks for your prompt reply
I tried it with normal rclone command like rclone ls --max-age 10m. It works as expected.
However when it comes to rclone rc and passing MaxAge as json, it has some delay.

I did as follow to test:

  1. Created a new file
  2. Set the MaxAge rclone rc options/set --json "{\"main\":{\"MaxDepth\":3},\"filter\":{\"MaxAge\":600000000000}}" --rc-addr=<ip:port> --rc-user=<user> --rc-pass=<pass>
  3. frequently listing files rclone rc operations/list --json "{\"fs\":\"filesystem:\",\"remote\":\"adw\",\"opt\":{\"recurse\":true}}" --rc-addr=<> --rc-user=<> --rc-pass=<>
  4. That new file was listed in each run of rclone rc operations/list for about 12min. After 12 min it stopped listing the new file.

I tried this on Windows with rclone v1.49.1

Ah I see what is happening.

When you set MaxAge, rclone converts that into an absolute time at that point. So if you set MaxAge immediately before you use it, it should work I think.

1 Like

Do you mean I should run rclone rc options/set before each run of rclone rc operations/list
Little confused :wink: as rclone rc options/get shows me the value that I already set for MaxAge!!
So What is the reason that I need to reset it each time?


When you set it, rclone sets the value of an internal variables to the actual date/time that the MaxAge represents.

This could be fixed I think!

1 Like

Thanks ncw
I can see this in the log file
2019/10/24 01:02:38 DEBUG : --max-age 1M to 2019-09-24 01:02:38.9381345 +0100 BST m=-2591999.664842999
So it just simply returns me any file with modtime greater than 2019-09-24 01:02:38
But I think rclone updates this absolute time after a while, as rclone rc operations/list finally could return correct result after ~2 min delay!

That is correct.

Do you see another DEBUG message?

1 Like

I looked at DEBUG. It seems that I made a mistake . You are right it never updates the absolute time, and keeps returning the file even if the max age passed.

1 Like

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