Renaming files changes storage class in Google Cloud Storage

What is the problem you are having with rclone?

I use rclone to sync my backups to a bucket in Google Cloud Storage. I have lifecycle rules set so that older files use cheaper storage classes (e.g. coldline, archive). This works as expected until I rename a file and rclone syncs the rename. This file's storage class will revert back to standard, incurring a higher cost, despite the content not changing at all. If I change the name in Google Cloud Console, the storage class stays the same so this is not a Google Cloud limitation. From what I see in the logs it's because rclone copies the file to a new location on the server and then deletes the old file. Is there a way to make it actually rename the file instead (using a move instead of copy+delete)?

Run the command 'rclone version' and share the full output of the command.

rclone v1.69.1
- os/version: alpine 3.21.2 (64 bit)
- os/kernel: 6.1.0-13-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.0
- go/linking: static
- go/tags: none

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

Google Cloud Storage

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

rclone sync --exclude='.*' --track-renames --verbose /data/backup gcs:my-bucket-name/backup

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[gcs]
type = google cloud storage
bucket_policy_only = true
location = us-central1
service_account_file = /config/google.json
env_auth = true
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

I redacted this, if you think there could be anything else there that's relevant, I can paste more.

2025/04/10 22:18:24 INFO  : GCS bucket my-bucket path backup: Making map for --track-renames
2025/04/10 22:18:24 INFO  : GCS bucket my-bucket path backup: Finished making map for --track-renames
2025/04/10 22:18:24 DEBUG : GCS bucket my-bucket path backup: Waiting for checks to finish
2025/04/10 22:18:24 DEBUG : GCS bucket my-bucket path backup: Waiting for renames to finish
2025/04/10 22:18:24 DEBUG : sketch.txt: md5 = ded77e0f64e6ebfe83759259b40959e2 OK
2025/04/10 22:18:24 INFO  : sketch.txt: Copied (server-side copy) to: sketch-key.txt
2025/04/10 22:18:24 INFO  : sketch.txt: Deleted
2025/04/10 22:18:24 INFO  : sketch-key.txt: Renamed from "Dropbox/sketch.txt"
2025/04/10 22:18:24 DEBUG : GCS bucket my-bucket path backup: Waiting for transfers to finish
2025/04/10 22:18:24 DEBUG : Waiting for deletions to finish
2025/04/10 22:18:24 INFO  :
Transferred:             56 B / 56 B, 100%, 0 B/s, ETA -
Checks:              2682 / 2682, 100%
Deleted:                1 (files), 0 (dirs), 28 B (freed)
Renamed:                1
Transferred:            2 / 2, 100%
Server Side Copies:     1 @ 28 B
Elapsed time:        10.6s

welcome to the forum,

based on rclone docs, rclone cannot do server-side move.
https://rclone.org/overview/#optional-features


Note that while some tools in Cloud Storage make an object move or rename appear to be a unique operation, they are always a copy operation followed by a delete operation of the original object, because objects are immutable.
Caution: Because renaming and moving objects involves object deletion, doing so with objects whose storage class is Nearline storage, Coldline storage, or Archive storage can incur early deletion charges.
If you move an object in a bucket with hierarchical namespace enabled using the move object REST API, no early deletion fee is incurred, regardless of the storage class.