Rclone touch not working with mega

What is the problem you are having with rclone?

I tried using megasync, but the modified time of files is different.
I tried making sure, the mtime is the same using rclone touch, but it fails both using rclone touch directly, as well as using touch on rclone mount.

I tried replacing megasync with rclone and it worked for a time, but then it got blocked by mega so this isn't a permanent solution.

I'm just wondering if this function is simply not supported by mega through rclone. Thx!

What is your rclone version (output from rclone version)

Version:
rclone v1.55.1

  • os/type: linux
  • os/arch: arm
  • go/version: go1.16.3
  • go/linking: static
  • go/tags: none

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

Raspbian (Debian on Raspberrypi, ARM)

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

Mega.nz

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

rclone touch -t'2021-07-21T18:00:00' Mega:/<file> 
2021/07/23 11:38:36 ERROR : Attempt 1/3 failed with 1 errors and: touch: couldn't set mod time: can't set modified time
2021/07/23 11:38:36 ERROR : Attempt 2/3 failed with 1 errors and: touch: couldn't set mod time: can't set modified time
2021/07/23 11:38:36 ERROR : Attempt 3/3 failed with 1 errors and: touch: couldn't set mod time: can't set modified time
2021/07/23 11:38:36 Failed to touch: touch: couldn't set mod time: can't set modified time

The rclone config contents with secrets removed.

Config:
[Mega]
type = mega
user = <email>
pass = <pw>

A log from the command with the -vv flag

rclone touch -t'2021-07-21T18:00:00' Mega:<file> -vv
2021/07/23 13:19:32 DEBUG : Using config file from "/home/pi/.config/rclone/rclone.conf"
2021/07/23 13:19:32 DEBUG : rclone: Version "v1.55.1" starting with parameters ["rclone" "touch" "-t2021-07-21T18:00:00" "Mega:<file>" "-vv"]
2021/07/23 13:19:32 DEBUG : Creating backend with remote "Mega:<folder>"
2021/07/23 13:19:39 DEBUG : fs cache: renaming cache item "Mega:<folder>" to be canonical "Mega:<folder>"
2021/07/23 13:19:39 ERROR : Attempt 1/3 failed with 1 errors and: touch: couldn't set mod time: can't set modified time
2021/07/23 13:19:39 ERROR : Attempt 2/3 failed with 1 errors and: touch: couldn't set mod time: can't set modified time
2021/07/23 13:19:39 ERROR : Attempt 3/3 failed with 1 errors and: touch: couldn't set mod time: can't set modified time
2021/07/23 13:19:39 DEBUG : 9 go routines active
2021/07/23 13:19:39 Failed to touch: touch: couldn't set mod time: can't set modified time

Please see:

https://rclone.org/mega/#modified-time-and-hashes

As it's not supported on mega.

Thanks for finding the link. I just wrote a script that reads the mtime from mega and updates mtime on my local part: If anyone sees this, here is the script:

find /mnt/mega -type f > files_to_touch.txt #mounted with rclone mount before
input="files_to_touch.txt"

while IFS= read -r line
do
        #echo "ls -lc \"$line\""
        fileWithPath=$(echo $line | sed 's/\/mnt\/mega\///g') #remove mountpoint
        fileMtime=$(stat -c %y "$line" | awk -F"." '{print $1}' | sed 's/\-//g' | sed 's/ //g' | sed 's/://' | sed 's/:/./') #get mtime and format it for touch

        echo "touch -t\"$fileMtime\" \"/media/wdbook/$fileWithPath\" "
done < "$input"

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