Modification Time / Date in mount

#1

rclone v1.47.0

  • os/arch: linux/amd64
  • go version: go1.12.4

Hello,
i am mounting an encrypted GDrive remote to /mnt/somedir/ of my Ubuntu VPS. This mount contains the media for an instance of airsonic running on the same VPS.
Initially, this seemed to work pretty well until i tried to refresh the airsonic database. As far as i can tell but couldn’t find any proof so far, airsonic seems to check the modification date to find out which items are new or have been changed. When i check the date / time info within the mount, it looks like it isn’tmodified just by adding content or other actions like renaming etc.
When i use a touch command to set the modification date manually, it sometimes lets airsonic find the updated content, but sometimes even this does not help to solve this issue. And i’ve also noticed that after touching a directory to change its modification date and time, it falls back to the original value after a certain ammount of time.
Is this a known behaviour especeally in combination with GDrive? Or am i totally wrong and it is something related to Linux rather than rclone? Would introducing another layer like mergefs help me with this issue?

#2

It is a known behavior. Google drive stores the modification times on files. A directory it doesn’t since a directory isn’t really that kind of object in this type of storage. The directory will not change and simply uses the time of when it was created and not when files were added to it.

#3

Thanks for letting me know about this.
Is there any workaround that can be used? When touching the directory on the linux system where it is mounted, the updated date and time is showing on the object when listed. But on a windows machine that can browse the same remote, date and time stay unchanged for the same directory.

#4

It shows still you unmount and remount. There isn’t really a work around.

#5

That is correct.

Google does store modification times for directories, but it doesn’t update the modification time if anything within the directory changes like a normal file system would. According to the docs a directory in google drive is just a special kind of file!

Rclone does not support setting modification times on directories yet.

You can touch a directory in a mount which will make a new modification time for the directory until the directory falls out of the directory cache when the old time will be re-read - that might be helpful.

$ ls -ld /mnt/tmp/2001test
drwxrwxr-x 1 ncw ncw 0 May 10 12:09 /mnt/tmp/2001test
$ touch /mnt/tmp/2001test
$ ls -ld /mnt/tmp/2001test
drwxrwxr-x 1 ncw ncw 0 May 11 10:30 /mnt/tmp/2001test