What is the problem you are having with rclone?
Files uploaded to remote with rclone sync command do not have their modified time stamps preserved. They are getting the current time. I have double checked and I am not using the --no-modtime parameter anywhere.
I am trying to create an automatic phone backup by modifying the sync script from the project (https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/blob/master/binary/syncd.sh). The script was originally using rclone copy and I changed it to rclone sync. Everything is working extremely well except that the mod date is not preserved when the file is uploaded. Unfortunately this is critical for an automatic sync project and I need to keep this modified date.
Below I have bolded parts of the logs below which look relevant.
What is your rclone version (output from rclone version
)
rclone v1.53.0-DEV
os/arch: android/arm
go version: go1.13.4
Which OS you are using and how many bits (eg Windows 7, 64 bit)
LineageOS 17 (Android 10)
Which cloud storage system are you using? (eg Google Drive)
pCloud
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
nice -n 19 ionice -c 2 -n 7 ${HOME}/rclone sync "/storage/emulated/${PROFILE}/${SYNCDIR}" "$CLOUDROOTMOUNTPOINT/${remote}/${SYNCDIR}" --retries-sleep=10m --retries 6 --transfers 1 --multi-thread-streams 1 --log-file=/storage/emulated/0/.rclone/file.log
Note: The $variables are part of the script, they are all working and the files upload and deleted from the remote successfully, this is essentially jsut a simple rclone sync command. The only problem is the mod time is not preserved.
My mount options
rclone mount remote: /mnt/cloud/remote --vfs-cache-mode off --cache-dir /data/rclone/cache --cache-chunk-path /data/rclone/cache-backend --cache-db-path /data/rclone/cache-backend --cache-temp-upload-path /data/rclone/cache --vfs-cache-max-size 1G --cache-chunk-size 1M --cache-chunk-total-size 1G --cache-workers 1 --cache-info-age 1h0m0s --dir-cache-time 30m0s --attr-timeout 30s --cache-chunk-no-memory --use-mmap --buffer-sizw 0 --max-read-ahead 128k --no-checksum --uid 0 --gid 1015 --allow-others --dir-perm 0775 --file-perms 0644 --umask 002 -fast-list --daemon
A log from the command with the -vv
flag
Script run #1:
2020/11/13 22:43:05 DEBUG : 3 go routines active
2020/11/13 22:43:10 DEBUG : rclone: Version "v1.53.0-DEV" starting with parameters ["/data/adb/modules/com.piyushgarg.rclone/rclone" "sync" "/storage/emulated/0/tests" "/mnt/cloud/remote/tests" "--retries-sleep=10m" "--retries" "6" "--transfers" "1" "--multi-thread-streams" "1" "--log-file" "/storage/emulated/0/.rclone/file.log" "-vv"]
2020/11/13 22:43:10 DEBUG : Creating backend with remote "/storage/emulated/0/tests"
2020/11/13 22:43:10 DEBUG : Using config file from "/data/adb/modules/com.piyushgarg.rclone/.config/rclone/rclone.conf"
2020/11/13 22:43:10 DEBUG : Creating backend with remote "/mnt/cloud/remote/tests"
2020/11/13 22:43:10 DEBUG : Local file system at /mnt/cloud/remote/tests: Waiting for checks to finish
2020/11/13 22:43:10 DEBUG : Local file system at /mnt/cloud/remote/tests: Waiting for transfers to finish
2020/11/13 22:43:10 DEBUG : **preAllocate: got error on fallocate, trying combination 1/2: operation not supported**
2020/11/13 22:43:10 DEBUG : **preAllocate: got error on fallocate, trying combination 2/2: operation not supported**
2020/11/13 22:43:11 DEBUG : testTime.1: MD5 = 62d4610f0d8b1a0fa57c1d3d820b39ef OK
2020/11/13 22:43:11 INFO : testTime.1: Copied (new)
2020/11/13 22:43:11 DEBUG : Waiting for deletions to finish
2020/11/13 22:43:11 INFO :
Transferred: 540 / 540 Bytes, 100%, 922 Bytes/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 0.6s
Result: test file is successfully transferred to remote. The modification date however is not preserved.
Note: there are two debug errors that I get every time I upload a file, could these be causing the date problem?
2020/11/13 22:43:11 DEBUG : 4 go routines active
2020/11/13 22:43:16 DEBUG : rclone: Version "v1.53.0-DEV" starting with parameters ["/data/adb/modules/com.piyushgarg.rclone/rclone" "sync" "/storage/emulated/0/tests" "/mnt/cloud/remote/tests" "--retries-sleep=10m" "--retries" "6" "--transfers" "1" "--multi-thread-streams" "1" "--log-file" "/storage/emulated/0/.rclone/file.log" "-vv"]
2020/11/13 22:43:16 DEBUG : Creating backend with remote "/storage/emulated/0/tests"
2020/11/13 22:43:16 DEBUG : Using config file from "/data/adb/modules/com.piyushgarg.rclone/.config/rclone/rclone.conf"
2020/11/13 22:43:16 DEBUG : Creating backend with remote "/mnt/cloud/remote/tests"
2020/11/13 22:43:16 DEBUG : Local file system at /mnt/cloud/remote/tests: Waiting for checks to finish
2020/11/13 22:43:16 DEBUG : testTime.1: **Modification times differ by 236h45m10.627350357s:** 2020-11-04 01:57:59.372649643 +0000 UTC, 2020-11-13 22:43:10 +0000 UTC
2020/11/13 22:43:17 DEBUG : testTime.1: MD5 = 62d4610f0d8b1a0fa57c1d3d820b39ef OK
2020/11/13 22:43:17 INFO : testTime.1: **Updated modification time in destination**
2020/11/13 22:43:17 DEBUG : testTime.1: Unchanged skipping
2020/11/13 22:43:17 DEBUG : Local file system at /mnt/cloud/remote/tests: Waiting for transfers to finish
2020/11/13 22:43:17 DEBUG : Waiting for deletions to finish
2020/11/13 22:43:17 INFO : There was nothing to transfer
2020/11/13 22:43:17 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Checks: 1 / 1, 100%
Elapsed time: 1.4s
Result: It looks like rclone can see the date problem, it reports that it has updated the file:
INFO : testTime.1: Updated modification time in destination
however it does not successfully change the file date.
Every subsequent script run will report the same date log lines everytime but it never fixes the date.
I have also tried using the --refresh-times parameter but it also did not work.
rclone lsl remote:/path/tests/ shows today's date and time:
540 2020-11-13 17:43:10.000000000 testTime.1
not the modified time of the file:
/storage/emulated/0/tests/
Nov 3, 2020 83:57:33 p.m. testTime.1
Accorging to this page, my remote (pcloud) does support modification times: https://rclone.org/pcloud/#modified-time-and-hashes
I have been working on this automatic backup project all week and this is the last critical piece of the puzzle. I can't find anything to get past this mod date problem. I know rclone is capable of preserving a file date, I am not sure why it is not working here.