Mega.nz - transfer files which are newer on the source

Hi there!

I'm currently using RClone to mirror a local drive to mega.nz. Everything works great, except there isn't support for modtime checking given that Mega doesn't allow to write the modification times of a file.

The way the platform works is that a modification time is set when the file is uploaded, so the modification time is in reality the upload time, and cannot be manually overwritten.

What I'd like to do is to make RClone compare the modification times to transfer the files that locally have a more recent modification time than the one on Mega. That way, even if it would not perfectly ensure modification times are equals, it would at least transfer the files that have changed since the last upload.

Which would be really helpful for me, as I have many files whose content change frequently but not size (e.g. updating audio files' metadata).

Is there a way to do this?

Thanks in advance for your help!

If you know time of your last upload or they happen at fixed intervals, then you can do something similar with --max-age.

Eg. --max-age="2022-01-10T15:04:05" or --max-age=2d.

1 Like

The problem is that I don't have the timestamp of the last upload, and also I need to do an initial transfer to transfer all the files that changed since their upload in a period of months, without transferring files that didn't change in the mean time. Which doesn't seem to be doable with this option :confused:

I guess you can find it as the newest file date found in Mega.

Not sure I understand the issue here, can you give a small example?

I guess you can find it as the newest file date found in Mega.

Good idea!

Not sure I understand the issue here, can you give a small example?

Let's say I have two files, A and B, which were transferred yesterday. Now let's say A's content has changed (and so its modification time changed as well) while B's didn't. How can I make RClone transfer only A and not B, given that it seemingly cannot check the modification time on Mega?

If I use --max-age, both seem to be transferred again.

You probably need a small overlap, so this could happen to a few files - but fileC modified the day before yesterday will not be considered.

You can test using something like:

rclone lsl /some/local/test/folder --max-age 1h

and then change/touch a few files in that folder and see what the commands returns every 30 minutes

Oh I think I'm starting to understand now. So what I should is, for each transfer, add --max-age <timestamp_of_last_transfer> so it will transfer every file whose modification is more recent than the provided timestamp, is that it?

In which case, the very first run (for the files that were modified long ago) would need to be done "by hand" (tell me if I'm wrong).

Yes, sounds like you have got it right :slight_smile:

You could start with a subfolder to verify your understanding.

--verbose will help you see what happens.
--dry-run will help you see what would happen (always recommended when trying something new)

1 Like

I'll try that.

Thanks a lot for your help! :smiley:

1 Like

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