Copyto exit code 0 instead of 9

What is the problem you are having with rclone?

My gitlab pipline fails when running rclone copyto, and I assume this is because it exits with status code 9 (operation successful, but no files transferred). This is expected as there are no changes to the files, but is there a way to enforce a status code 0 in this case? I expected it to default to 0 because there is an error-on-no-tranfer flag, but according to my pipeline I am getting a non-zero exit code without this flag.

What is your rclone version (output from rclone version)

v1.53.4

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

Linux 64 bit

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

AWS S3

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

yes | ./rclone copyto --config ../rclone.conf -i -v ../dist/ appshell:cf-app-shell/$DIR_NAME

The rclone config contents with secrets removed.

[appshell]
type = s3
env_auth = true
region = us-east-2
endpoint =
acl = authenticated-read
server_side_encryption = AES256
storage_class =
provider = AWS

A log from the command with the -vv flag

2021/02/01 21:01:59 DEBUG : rclone: Version "v1.53.4" starting with parameters ["./rclone" "copyto" "--config" "../rclone.conf" "-i" "-vv" "../dist/" "appshell:cf-app-shell/cf-app-shell"]
2021/02/01 21:01:59 DEBUG : Creating backend with remote "../dist/"
2021/02/01 21:01:59 DEBUG : Using config file from "/builds/mintel/frontend/frontend-app-shell/rclone.conf"
2021/02/01 21:01:59 DEBUG : fs cache: renaming cache item "../dist/" to be canonical "/builds/mintel/frontend/frontend-app-shell/dist"
2021/02/01 21:01:59 DEBUG : Creating backend with remote "appshell:cf-app-shell/cf-app-shell"
2021/02/01 21:02:00 DEBUG : S3 bucket cf-app-shell path cf-app-shell: Waiting for checks to finish
2021/02/01 21:02:00 DEBUG : main.js: Modification times differ by -94h45m30.031319171s: 2021-02-01 21:01:57.792928788 +0000 UTC, 2021-01-28 22:16:27.761609617 +0000 UTC
2021/02/01 21:02:00 DEBUG : main.js.LICENSE.txt: Modification times differ by -94h45m30.031319171s: 2021-02-01 21:01:57.792928788 +0000 UTC, 2021-01-28 22:16:27.761609617 +0000 UTC
2021/02/01 21:02:00 DEBUG : main.js.LICENSE.txt: MD5 = ea495b39d909066c50c7a5f321424409 OK
rclone: update modification time "main.js.LICENSE.txt"?
y) Yes, this is OK (default)
n) No, skip this
s) Skip all update modification time operations with no more questions
!) Do all update modification time operations with no more questions
q) Exit rclone now.
y/n/s/!/q> 2021/02/01 21:02:00 DEBUG : index.html: Modification times differ by -3h55m27.615225821s: 2021-02-01 21:01:57.800928873 +0000 UTC, 2021-02-01 17:06:30.185703052 +0000 UTC
2021/02/01 21:02:00 DEBUG : index.html: MD5 = 19de1f0d22e47ce04a00bde28c5d0be7 OK
rclone: update modification time "index.html"?
y) Yes, this is OK (default)
n) No, skip this
s) Skip all update modification time operations with no more questions
!) Do all update modification time operations with no more questions
q) Exit rclone now.
y/n/s/!/q> 2021/02/01 21:02:00 DEBUG : main.js: MD5 = ecffeda4e3051cd35dadc914be2ea25a OK
rclone: update modification time "main.js"?
y) Yes, this is OK (default)
n) No, skip this
s) Skip all update modification time operations with no more questions
!) Do all update modification time operations with no more questions
q) Exit rclone now.
y/n/s/!/q> 2021/02/01 21:02:00 INFO  : index.html: Updated modification time in destination
2021/02/01 21:02:00 DEBUG : index.html: Unchanged skipping
2021/02/01 21:02:00 INFO  : main.js.LICENSE.txt: Updated modification time in destination
2021/02/01 21:02:00 DEBUG : main.js.LICENSE.txt: Unchanged skipping
2021/02/01 21:02:00 INFO  : main.js: Updated modification time in destination
2021/02/01 21:02:00 DEBUG : main.js: Unchanged skipping
2021/02/01 21:02:00 DEBUG : S3 bucket cf-app-shell path cf-app-shell: Waiting for transfers to finish
2021/02/01 21:02:00 INFO  : There was nothing to transfer
2021/02/01 21:02:00 INFO  : 
Transferred:   	         0 / 0 Bytes, -, 0 Bytes/s, ETA -
Checks:                 3 / 3, 100%
Elapsed time:         0.6s
2021/02/01 21:02:00 DEBUG : 9 go routines active

hello and welcome to the forum,

this is interesting, as rclone should return a status code 0.

perhaps rclone is getting confused, since a file in the dest had its mod time updated.

1 Like

You're right... I added the --no-update-modtime flag and that fixed the issue. Thank you!

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