What is the problem you are having with rclone?
I am trying to list files and check the upload time using the --use-server-modtime
flag, but it doesn't work on one SFTP server
Run the command 'rclone version' and share the full output of the command.
rclone 1.65.0
- os/version: nixos 24.05 (Uakari) (64 bit)
- os/kernel: 6.1.69 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.5
- go/linking: dynamic
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
SFTP & Local
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone copy -vv Downloads/test/2MB.mp4 sftp:/others/
Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.
[sftp]
type = sftp
host = XXXXXX
user = admin
pass = verysecretpassword
use_insecure_cipher = true
shell_type = none
A log from the command that you were trying to run with the -vv
flag
rclone copy -vv Downloads/test/2MB.mp4 sftp:/others/
<7>DEBUG : rclone: Version "1.65.0" starting with parameters ["/etc/profiles/per-user/user/bin/rclone" "copy" "-vv" "Downloads/test/2MB.mp4" "sftp:/others/"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "Downloads/test/2MB.mp4"
<7>DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
<7>DEBUG : fs cache: adding new entry for parent of "Downloads/test/2MB.mp4", "/home/user/Downloads/test"
<7>DEBUG : Creating backend with remote "sftp:/others/"
<7>DEBUG : sftp://admin@host.com:22//others/: New connection XXX.XXX.XXX.XXX:34554->XXX.XXX.XXX.XXX:22 to "SSH-2.0-WeOnlyDo-wodFTPD 3.2.2.395"
<7>DEBUG : sftp://admin@host.com:22//others/: Shell type "none" from config
<7>DEBUG : sftp://admin@host.com:22//others/: Using root directory "/others/"
<7>DEBUG : 2MB.mp4: Size and modification time the same (differ by 0s, within tolerance 1s)
<7>DEBUG : 2MB.mp4: Unchanged skipping
<6>INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Elapsed time: 2.3s
<7>DEBUG : 13 go routines active
<7>DEBUG : sftp://admin@host.com:22//others/: Closing 1 unused connections
~ took 2s ❯ rclone copy -vv Downloads/test/2MB.mp4 sftp:/others/
<7>DEBUG : rclone: Version "1.65.0" starting with parameters ["/etc/profiles/per-user/user/bin/rclone" "copy" "-vv" "-u" "Downloads/test/2MB.mp4" "sftp:/others/"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "Downloads/test/2MB.mp4"
<7>DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
<7>DEBUG : fs cache: adding new entry for parent of "Downloads/test/2MB.mp4", "/home/user/Downloads/test"
<7>DEBUG : Creating backend with remote "sftp:/others/"
<7>DEBUG : sftp://admin@host.com:22//others/: New connection XXX.XXX.XXX.XXX:37512->XXX.XXX.XXX.XXX:22 to "SSH-2.0-WeOnlyDo-wodFTPD 3.2.2.395"
<7>DEBUG : sftp://admin@host.com:22//others/: Shell type "none" from config
<7>DEBUG : sftp://admin@host.com:22//others/: Using root directory "/others/"
<7>DEBUG : 2MB.mp4: Need to transfer - File not found at Destination
<3>ERROR : sftp://admin@host.com:22//others/: Move: Failed to remove existing file "/others/2MB.mp4": sftp: "Bad message" (SSH_FX_BAD_MESSAGE)
<7>DEBUG : 2MB.mp4.yezigek2.partial: renamed to: 2MB.mp4
<6>INFO : 2MB.mp4: Copied (new)
<6>INFO :
Transferred: 1.943 MiB / 1.943 MiB, 100%, 497.405 KiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 7.2s
<7>DEBUG : 15 go routines active
<7>DEBUG : sftp://admin@host.com:22//others/: Closing 1 unused connections
So if I execute rclone lsjson -u sftp:/others/ --use-server-modtime | jq
, the modification time of the .partial
file is correct, but as soon as the file is fully transferred to the SFTP server and renamed to the original filename, its modification time is back to 2021, which is incorrect.
[
{
"Path": "2MB.mp4.rayirav8.partial",
"Name": "2MB.mp4.rayirav8.partial",
"Size": 0,
"MimeType": "video/mp4",
"ModTime": "2024-01-03T16:14:45+01:00",
"IsDir": false
}
]
and this is when the file is fully transferred to the SFTP server.
[
{
"Path": "2MB.mp4",
"Name": "2MB.mp4",
"Size": 2037627,
"MimeType": "video/mp4",
"ModTime": "2022-12-31T14:30:59+01:00",
"IsDir": false
}
]
My is that I would like to run filter where I provide --min-age
and --max-age
relative to the upload timestamp, but with this incorrect modtime I would be unable to do it.